World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Internship Partner

In Association with
In collaboration with



Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
New to InsideAIML? Create an account
Employer? Create an account
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
Enter your email below and we will send a message to reset your password
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Download our e-book of Introduction To Python
4.5 (1,292 Ratings)
589 Learners
Rohit Mohite
2 years ago
import getpass
import telnetlib
HOST = "http://localhost:8000/"
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())
- lrwxrwxrwx 1 0 0 1 Nov 13 2012 ftp -> .
- lrwxrwxrwx 1 0 0 3 Nov 13 2012 mirror -> pub
- drwxr-xr-x 23 0 0 4096 Nov 27 2017 pub
- drwxr-sr-x 88 0 450 4096 May 04 19:30 site
- drwxr-xr-x 9 0 0 4096 Jan 23 2014 vol