Hello All,
I'm trying to telnet to a device with a particular IP address. I'm using the
sample code below and get the following error:
Erro 10061: "No connection could be made because the target machine actively
refused it"
My firewall is turned off.
I'm using Python 2.7
I'm using Windows XP
When I'm prompted for remote account, i enter the user name and then im
prompted for the password which enter as well.
I'm able to connect to the device using putty with following settings:
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()
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor