0

Am running a example script of telnet lib and observed that the script is printing out on to the console.

import getpass
import sys
import telnetlib

HOST = "xxxxxxxxx"
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()

and the it return nothing The Target is windows machine and source where the script is executed is linux.

Sagar
  • 21
  • 1
  • 5

0 Answers0