WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: getting telnetd working/responding [SOLVED]  (Read 9522 times)

Offline fremth

  • Newbie
  • *
  • Posts: 4
getting telnetd working/responding [SOLVED]
« on: September 15, 2011, 03:34:41 PM »
I'm new here -- and new with Tiny Core -- please bear with me :)  I installed the current tc (3.8.4) onto a partition on a hard disk a few days ago. 

I'm trying to get the telnet server going on the tc installation.

I have downloaded/installed inetutils-servers.tcz (which I believe contains telnetd) and openssh.tcz, as persistent.  These two, as well as tcp-wrappers.tcz are by now listed in the Apps Audit applet as 'On Boot Items', which means these are made available on boot, right?  (tcp-wrappers I understand is installed as a dependency of telnetd).

I created the entries

/usr/local/sbin/inetd&
/usr/local/sbin/telnetd&

and

/usr/local/sbin/sshd&

in /opt/bootlocal.sh

so that these are started up at boot time, if I understand correctly.

I created /opt/hosts.allow such that it is copied to /etc/hosts.allow on boot, within the bootsynch.sh script, per the instructions for 'passwd' on the wiki.  And made the permissions available for localhost (tc) to access all services.

However, when I try to 'telnet localhost' or 'ssh localhost', I get 'connection refused'.

I installed nmap and lsof persistenly, with a view to gaining some insight about what is happening.  But nmap localhost reports 'All [..] ports [..] closed', and lsof does not seem to show any LISTENing ports.

I'd love to be able to adminstrate the tc install from my main pc via telnet (the tc install is not connected to the outside world at all, so there are IIRC no security implications) ... if anybody can let me know what I've missed, or where I'm going wrong, I'd be exceedingly grateful ...

fremth
« Last Edit: September 19, 2011, 10:22:32 AM by fremth »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: getting telnetd working/responding
« Reply #1 on: September 15, 2011, 04:41:58 PM »
No, you have it all wrong.

You need to create 2 files in /etc

# /etc/protocols
tcp     6       TCP
udp     17      UDP

#/etc/inetd.conf
telnet  stream tcp nowait root /usr/local/sbin/telnetd telnetd

add the following 2 lines to /opt/.filetool.lst:
etc/protocols
etc/inetd.conf

Add the following line to /opt/bootlocal.sh:
/usr/local/sbin/inetd /etc/inetd.conf

Then run 'filetool.sh -b'

See: http://www.manpagez.com/man/8/inetd/

--------- Edit --------
Neither OpenSSH nor DropBear are inet daemons.
They both have their configuration files that need to be backed-up
and they both have startup scripts in /usr/local/etc/init.d
« Last Edit: September 15, 2011, 05:04:23 PM by gerald_clark »

Offline fremth

  • Newbie
  • *
  • Posts: 4
Re: getting telnetd working/responding
« Reply #2 on: September 19, 2011, 05:38:01 AM »
Thank you very much gerald_clark for the instructions.  (I have been spoiled by coming from Debian, where telnetd works without further intervention, once installed.  That's not to say I don't mind learning how to do this manually in TC, and am grateful for the info.)

Now telnetd is working.  There is a glitch though.  On my installation, and running the inetd command you gave within bootlocal.sh, nmap box reports all ports closed, and invoking telnet continues to result in 'connection refused'.  If I then run the inetd command manually at the cli (post boot up, to be clear) nmap box shows the telnet port as open, and telnet is available and responding.

If you or anybody can suggest a fix, or a workaround for instance, such as a way to run a script (to start inetd automatically once the system has booted), I'd be very grateful.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: getting telnetd working/responding
« Reply #3 on: September 19, 2011, 06:10:18 AM »
Hmmm, I could imagine that at the time '/opt/bootlocal.sh' runs the NIC is not yet ready. Maybe you could insert something like this:
Code: (bash) [Select]
while [ $( ifconfig eth0 | grep -cE '^  *(UP|inet) ' ) != 2 ] ; do
    sleep 1
done
prior to starting the 'inetd' daemon. This is obviously to wait until the NIC is UP and has an IP address assigned.

Offline fremth

  • Newbie
  • *
  • Posts: 4
Re: getting telnetd working/responding
« Reply #4 on: September 19, 2011, 07:10:37 AM »
It works ... thank you for the necessary voodoo!

I would mark my inquiry as 'solved', if I knew how to do that ... perhaps only a moderator can, I could not see how to do so from a quick perusal of the faq page.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: getting telnetd working/responding
« Reply #5 on: September 19, 2011, 09:15:05 AM »
Hi fremth
Go to your first post and click the  Modify  button, add  [Solved]  to the subject line, and click save.

Offline fremth

  • Newbie
  • *
  • Posts: 4
Re: getting telnetd working/responding [SOLVED]
« Reply #6 on: September 19, 2011, 10:24:14 AM »
done, thank you ...