Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Connecting to a telnet server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Rinkhals
Apprentice
Apprentice


Joined: 02 May 2003
Posts: 165
Location: Scotland

PostPosted: Fri Mar 20, 2009 9:13 pm    Post subject: Connecting to a telnet server Reply with quote

I want to run some tests on a telnet server.

For this I want my Gentoo box to accept a telnet session.

I am fully aware of the dangers of using telnet and am also aware that I'm better off using ssh, but, for the purpose of these tests I just want to run a telnet server.

The problem is that after I connect to the Gentoo box it disconnects after 2 or 3 seconds.

I believe that this is because of PAM.

How can I get my server to run?

Many thanks,

Rinki.
_________________
"I'm a Snake if we Disagree" - Jethro Tull, "Bungle in the Jungle"
Back to top
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Sat Mar 21, 2009 2:20 am    Post subject: Reply with quote

sounds more like a TCP wrappers issue to me at first blush.

do you have the "tcpd" USE flag set (for whichever telnetd)?
Back to top
View user's profile Send private message
Rinkhals
Apprentice
Apprentice


Joined: 02 May 2003
Posts: 165
Location: Scotland

PostPosted: Sat Mar 21, 2009 7:05 am    Post subject: Reply with quote

Tony,

Thanks for the reply

>do you have the "tcpd" USE flag set (for whichever telnetd)?

No I just ran 'emerge netkit-telnetd' without additional arguments.

However, I have just run
Code:
USE="tcpd" emerge netkit-telnetd


But this has not changed the behaviour of the telnet server. :(
_________________
"I'm a Snake if we Disagree" - Jethro Tull, "Bungle in the Jungle"
Back to top
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Sat Mar 21, 2009 3:41 pm    Post subject: Reply with quote

telnetd is usually handled by inetd, so what's in /etc/xinetd.d/telnetd ? disable = yes, or no?

and is xinetd (a) emerge'd and (b) running?

you can also ask telnetd to tell you some things about what it's doing, e.g. from the command-line

Code:
in.telnetd -D report -debug 23


does a "one shot" telnet daemon. When you telnet to localhost in another window you'll get some info that might help.
Back to top
View user's profile Send private message
Rinkhals
Apprentice
Apprentice


Joined: 02 May 2003
Posts: 165
Location: Scotland

PostPosted: Sat Mar 21, 2009 10:35 pm    Post subject: Reply with quote

> telnetd is usually handled by inetd, so what's in /etc/xinetd.d/telnetd ? disable = yes, or no?
It was set on 'no': changed to yes.

> and is xinetd (a) emerge'd and (b) running?
xinetd has been started: /etc/init.d/xinetd restart

> in.telnetd -D report -debug 23
> does a "one shot" telnet daemon. When you telnet to localhost in another window you'll get some info that might help.
Not sure I understand. Returns "telnetd: getpeername: Socket operation on non-socket"

Thanks.
_________________
"I'm a Snake if we Disagree" - Jethro Tull, "Bungle in the Jungle"
Back to top
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Sat Mar 21, 2009 10:42 pm    Post subject: Reply with quote

>> telnetd is usually handled by inetd, so what's in /etc/xinetd.d/telnetd ? disable = yes, or no?
> It was set on 'no': changed to yes.

Ahhh, so telnetd was enabled, but now you've turned it off. Well, no matter for testing in the meanwhile...

[I don't think disable=Bool is a good idea, it's a double-negative and is confusing]

>> and is xinetd (a) emerge'd and (b) running?
> xinetd has been started: /etc/init.d/xinetd restart

OK

>> in.telnetd -D report -debug 23
>> does a "one shot" telnet daemon. When you telnet to localhost in another window you'll get some info that might help.
> Not sure I understand. Returns "telnetd: getpeername: Socket operation on non-socket"

Really? Did you enter the whole command-line? If you run in.telnetd on its own, that's the error message you'll get. "-debug <port>" (as in the man page) does a 1-shot and runs the daemon manually.
Back to top
View user's profile Send private message
Rinkhals
Apprentice
Apprentice


Joined: 02 May 2003
Posts: 165
Location: Scotland

PostPosted: Sun Mar 22, 2009 7:25 am    Post subject: Reply with quote

> Ahhh, so telnetd was enabled, but now you've turned it off. Well, no matter for testing in the meanwhile...
So I change it back to 'no' then? It doesn't appear to make any difference to the behaviour, namely that it disconnects immediately after connecting.
I notice that there is an option in the file which says 'wait = no'. If I change this to 'yes' I get the following message just prior to the disconnection:
Get error [10054]: An existing connection was forcibly closed by the remote host.

> Really? Did you enter the whole command-line? If you run in.telnetd on its own, that's the error message you'll get. "-debug <port>" (as in the man page) does a 1-shot and runs the daemon manually.

Sorry. Typo. (I had omitted the '-' in front of debug). It now returns:
telnetd: bind: Address already in use

OK, so I stop xinetd and then run in.telnetd and it works!
Code:
Connected!
Disconnected!
Connected!
Get error [10054]: An existing connection was forcibly closed by the remote host.
Disconnected!
Connected!
Get error [10054]: An existing connection was forcibly closed by the remote host.
Disconnected!
Connected!
Disconnected!
Connected!
Get error [10054]: An existing connection was forcibly closed by the remote host.
Disconnected!
Connected!
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do NEW-ENVIRON
td: ttloop

td: ttloop read 3 chars
td: recv wont TERMINAL TYPE
td: ttloop

td: ttloop read 9 chars
td: recv wont TSPEED
td: recv wont XDISPLOC
td: recv wont NEW-ENVIRON
td: send will SUPPRESS GO AHEAD
td: send do ECHO
td: send do NAWS
td: send will STATUS
td: send do LFLOW
td: ttloop

td: ttloop read 3 chars
td: recv will ECHO
td: ttloop

td: ttloop read 9 chars
td: recv wont NAWS
td: recv dont STATUS
td: recv wont LFLOW
td: simulating recv
td: recv will ECHO
td: send dont ECHO
td: send will ECHO
td: Entering processing loop

Linux 2.6.22.18-co-0.7.3 (Frodo) (0)

Frodo login:
td: netread 3 chars
td: recv wont ECHO

td: netread 6 chars

td: ptyflush 5 chars
dave
Password:
td: netread 8 chars

td: ptyflush 7 chars


Last login: Thu Mar 19 05:47:17 PDT 2009 from 192.168.37.43 on pts/0
dave@Frodo ~ $


This is quite adequate for my tests.

Thanks very much, Tony!

Dave Coventry
_________________
"I'm a Snake if we Disagree" - Jethro Tull, "Bungle in the Jungle"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum