I am trying to use telnet to get some information back from a machine, and this is what I doing. from windows in putty I set it up to be telnet, put the ip and the port, and connect, I do get the console where it say:
Type the hot key to suspend the connection: Z and the cursor is blinking at the beginning of the next line. I hit enter in the keyboard. and I can start typing commands like ls.
my code is very simple. since there is no or password
import telnetlib
tn = telnetlib.Telnet("10.35.180.239", port=7033)
tn.write("\n")
#n.write("vt102\n") # we might need to tell the type of console?
tn.write("ls\n")
print tn.read_all()
tn.close()
some one mention in this link telnetlib python example that we needed to write the type of console we are using, but I didn't get a diferent outcome.
this is what I get in my console.
ls
This connection is in use. User(s) currently connected: NONE@440.
You need privilege to make a simultaneous session.
may I be missing some steps? or there is something magical that needs to bet set up?
thank you guys.