HT telnet interact with auto login?
Paul Boehm
paul at soniq.net
Sun Jun 16 17:06:29 EDT 2002
is this what you want?
# On Sun, Jun 16, 2002 at 06:07:30PM +0000, Klaus Reinhardt wrote:
import getpass
import sys
import telnetlib
HOST = "...de"
tn = telnetlib.Telnet(HOST)
user = '...'
password = '...'
# 2.)
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")
# 1.)
tn.interact() # this is working but with manually ..
More information about the Python-list
mailing list