Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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("lsn")
- tn.write("exitn")
- print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement