HT telnet interact with auto login?
cliechti at gmx.net
Sun Jun 16 21:55:15 CEST 2002
K.Rdt at TU-Berlin.DE (Klaus Reinhardt) wrote in
news:3d0cd198.17917980 at news.zrz.tu-berlin.de:
> I want to combine:
> import getpass
> import sys
> import telnetlib
> HOST = "...de"
> tn = telnetlib.Telnet(HOST)
> user = '...'
> password = '...'
> tn.interact() # this is working but with manually ..
> tn.read_until("login: ") # this seams to work
> # but without connection
> tn.write(user + "\n")
> if password:
> tn.read_until("Password: ")
> tn.write(password + "\n")
i don't understand your question... but often a '\r\n' is required
as end of line. maybe this helps :-)
Chris <cliechti at gmx.net>
More information about the Python-list