[Tutor] A Telnet problem

Roger Merchberger zmerch at 30below.com
Sun Sep 5 23:25:39 CEST 2004


Rumor has it that W X Liu may have mentioned these words:
>Hi friends:
>
>I am writing a program to connect a MUD(Telnet) server, here is the program:
>
>import telnetlib
>a=telnetlib.Telnet(host='mudlib.anarres.org',port='5000')
>a.read_until('login:')
                ^
Are you sure they're lowercase? Case sensitivity will create havoc here... ;-)

It's better to do this:

>a.read_until('ogin:')

A trick from the old BBS dayz... ;-)

>b=str('abb'+chr(10))

Why are you adding this?

>a.write(b+ "\n")

And this... Are you *sure* that the server's hosted on a Winders PC & 
*requires* a Winders line-ending? Most telnet servers don't...

>b=str('528950'+chr(10))
>a.read_until('password:')
>a.write(b+ "\n")

You know cleartext passwords are a security no-no, right? ;-)

>But it doesn't work, who can help me to fix it? Thanks a lot.

When I was working with telnetlib, I was connecting to a USRobotics modem 
server, but telnets being telnets, this is what I had to do to to get the 
computer to recognize the text:

>b=str('528950')
>a.read_until('assword:')
>a.write(b+ "\r")
              ^^
Note the \r -> This is what worked for me for a line-ending when working 
with telnetlib, but I have never connected to anything else other than that 
USR box.

HTH,
Roger "Merch" Merchberger

--
Roger "Merch" Merchberger   ---   sysadmin, Iceberg Computers
Recycling is good, right???  Randomization is better!!!

If at first you don't succeed, nuclear warhead
disarmament should *not* be your first career choice.



More information about the Tutor mailing list