[Tutor] Telnet login
Dave Angel
d at davea.name
Fri Nov 9 03:57:48 CET 2012
On 11/08/2012 09:33 PM, T. Girowall wrote:
> <snip>
> ip: 192.168.xx.xx
> port: 2332
>
> Any help is appreciated,
> Tim
> import getpass import sys import telnetlib HOST = "localhost" user = raw_input("Enter your remote account: ") password = getpass.getpass() tn = telnetlib.Telnet(HOST) tn.read_until("login: ") tn.write(user + "\n") if password: tn.read_until("Password: ") tn.write(password + "\n") tn.write("ls\n") tn.write("exit\n") print tn.read_all()
>
>
This is a text mailing list; your html mail thoroughly mangles your
code for the majority of readers.
Is there a reason why you used 192.168.xx.xx with putty, but used
localhost with your python code?
--
DaveA
More information about the Tutor
mailing list