telnet to PM <= 4.9 : Connection closed by foreign host

Found a bug in Parted Magic?

Moderators: Patrick Verner, Icecube

telnet to PM <= 4.9 : Connection closed by foreign host

Postby burdi01 » Sun Feb 07, 2010 2:46 pm



To be able to telnet into a running PartedMagic instance I added a /etc/hosts and a
/etc/nsswitch.conf file and in the /etc/inetd.conf file enabled telnetd (by removing the leading "#" from the pertinent line).
The above results in all telnets in being refused with a "Connection closed by foreign host" message.
The /var/log/messages file shows a "daemon.err telnetd[<pid>]: bind: Address already in use" message.

A "telnetd --help" revealed that the BusyBox /sbin/telnetd applet needs a "-i" option to run as an inetd subservice. Please add that "-i" to the end of the "telnet" line in /etc/inetd.conf.

Also please add a /etc/hosts and a /etc/nsswitch.conf file.


Latest Parted Magic development version: http://beefdrapes.partedmagic.com
burdi01
 
Posts: 359
Joined: Fri Sep 25, 2009 1:02 pm
Location: The Netherlands

Re: telnet to PM <= 4.9 : Connection closed by foreign host

Postby Patrick Verner » Sun Feb 07, 2010 3:37 pm

Can you see if the test version I just uploaded works like you expect?

http://beefdrapes.partedmagic.com
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 881
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: telnet to PM <= 4.9 : Connection closed by foreign host

Postby burdi01 » Mon Feb 08, 2010 11:20 am

Dear Patrick,

Tested with 4.9 07 Feb.092559: Telnetting in remotely (from another box to the PM instance) works as expected. Alas a "telnet localhost" on the PM instance does not:

root@PartedMagic:~# telnet localhost
i: applet not found
Connection closed by foreign host
root@PartedMagic

As per the inetd.conf man page the "-i" should only be stated for field7, so remove the "-i" for field6.

Whether or not the inetd.conf "telnet" line should be commented out by default and whether or not root should have a password is a design question. I personally do not object against uncommenting that line and setting a root password in an install/doinst.sh or /tmp/scripts/ script.

Yesterday I forgot to mention (sorry) that /etc/securetty needs a few additional entries: pts/0 through pts/5 - without these a "telnet localhost" will fail with a "Login incorrect" message.

And last but not least, for as far as I am aware it is common practice to have the hostname in the /etc/hosts file, so your 2nd line should read:
127.0.0.1 PartedMagic.example.org PartedMagic

Kind regards, Dick
Latest Parted Magic development version: http://beefdrapes.partedmagic.com
burdi01
 
Posts: 359
Joined: Fri Sep 25, 2009 1:02 pm
Location: The Netherlands

Re: telnet to PM <= 4.9 : Connection closed by foreign host

Postby Patrick Verner » Mon Feb 08, 2010 11:11 pm

I have uploaded my latest attempt to get this corrected...
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 881
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: telnet to PM <= 4.9 : Connection closed by foreign host

Postby burdi01 » Tue Feb 09, 2010 9:54 am

Dear Patrick,
The 4.9 08Feb.165543 iso indeed resolves all telnet (remote and local) problems.
Thank you, Dick
Latest Parted Magic development version: http://beefdrapes.partedmagic.com
burdi01
 
Posts: 359
Joined: Fri Sep 25, 2009 1:02 pm
Location: The Netherlands


Return to Bugs

Who is online

Users browsing this forum: No registered users and 3 guests