Questions tagged [telnetlib]

The telnetlib module provides a Telnet class that implements the Telnet protocol under Python programming language.

The telnetlib module provides a Telnet class that implements the Telnet protocol under Python programming language.

See RFC 854 for details about the Telnet protocol.

In addition, telnetlib provides symbolic constants for the protocol characters (see below), and for the telnet options. The symbolic names of the telnet options follow the definitions in arpa/telnet.h, with the leading TELOPT_ removed. For symbolic names of options which are traditionally not included in arpa/telnet.h, see the module source itself.

Read more about telnetlib at python docs..

318 questions
0
votes
1 answer

Telnetlib get unreadable character while cygwin or putty not

I found a strange problem with python's telnetlib module. When I use the telnetlib to access a server and try to get the information, it always show some strange character, and I am sure its not the encoding problem, the output just like…
lowitty
  • 904
  • 1
  • 8
  • 13
0
votes
1 answer

Python 2.7.6 telnetlib HardCode Password

I have made a script which is used to run an APP on MACOS It basically controls camera using and IP address My problem is it required a password I am using the http://docs.python.org/2/library/telnetlib.html#telnetlib.Telnet example from here but it…
user3337714
  • 663
  • 1
  • 7
  • 25
0
votes
1 answer

connect to telnet in python with a quizz as login?

I need to connect to a remote server via telnet. To authenticate to the server I have to answer like a 100 questions. So I tried to automate this task in python using telnetlib but the prompt halts without returning any message. here is what I…
Mohamed Ali JAMAOUI
  • 14,275
  • 14
  • 73
  • 117
0
votes
0 answers

UnicodeDecodeError writing values from JSON to file

I have a CGI script in python that uses Telnetlib to send telnet commands. I get appropriate information (in this case the 'nameID' from the javascript in the form of a JSON, and then send the appropriate commands with regard to the information…
Sven
  • 55
  • 7
0
votes
0 answers

Better solution to overcome Connection reset by peer error in python telnet lib?

> retry = range(3) > for attempt in retry: try: > try: > tn = telnetlib.Telnet(HOST) > except exception as e: > log error > > firing cmd > break …
Python_Dude
  • 507
  • 6
  • 12
0
votes
0 answers

How to reset a comserver via telnet using a python script with telnetlib

I want to write a python script that automatically resets a com server. For this aim, the script has to transmit the commands "2","5","y" I already wrote this little program: import sched import time import sys from LoggerTelnet import…
Marcel Gangwisch
  • 8,856
  • 4
  • 23
  • 32
0
votes
1 answer

Using TelnetLib with a Cisco Wireless Controller

I'm trying to write scripting to make networking easier, and I can connect to the Cisco Switches, but I am unable to connect to a Cisco Wireless Controller. When I connect, it closes the connection with the following message. Raw mode will not be…
iargue
  • 69
  • 2
  • 13
0
votes
1 answer

Python and telnetlib on 2.7. Totally not working for me

Below is the streaming data that i get when I connect from a command line. Yet..quit shocking...I get no data from from python. Why cant I print to screen the output? One would think I should just connect to to server, ready very eager. tn =…
Tampa
  • 75,446
  • 119
  • 278
  • 425
0
votes
2 answers

Using Python to Telnet into CISCO router and store the output on a machine locally

Im new to python, I managed to telnet into my cisco router using my python codes. I am able to show commands on the screen, but I would like to save the outputs locally on my linux machine, same place where the python script lives. Any…
user2735532
  • 1
  • 1
  • 1
0
votes
1 answer

Send commands to a remote machine application with Python

I want to do the following in Python. Connect to a remote machine open an application there and then send some commands to this application. My idea was to do it through telnetlib and subprocess. I managed to connect to the machine and start the…
Cooli
  • 169
  • 3
  • 14
0
votes
2 answers

Telnet not working for os.system call

Why cant I call the following in python using os? import os os.system('telnet 1.1.1.1') yet when I open a terminal and use the exact command, I can telnet. I get the following when running the code: 'telnet' is not recognized as an internal or…
JonStanley91
  • 19
  • 1
  • 6
0
votes
1 answer

Execute a CLI command and store in a variable using telnetlib

I am using Python telnetlib for taking the "running config" output from router.How to store the "show running-config" output in a variable.And print the variable.My requirement is the each and every output will display in the console when executing…
gmanikandan
  • 475
  • 3
  • 10
  • 16
0
votes
2 answers

How to read Mozrepl Javascript result into a Python Variable?

With Mozrepl addon in Firefox and Python I do: >>> import telnetlib >>> tn = telnetlib.Telnet(r'127.0.0.1', 4242, 5) >>> tn.read_eager() '\nWelcome to MozRepl.\n\n - If you get stuck at the "' >>> tn.read_until("repl> ") ...snip... >>>…
user1325143
  • 213
  • 1
  • 5
  • 15
0
votes
2 answers

Perl telnet command not sending every command

I have the following program below which telnets into another device and prints serial number and Mac address. My problem is that for some reason if I send the command once it skips the first command and sends the second, but if I copy the same…
0
votes
1 answer

How to write on terminal after login with telnet to remote machine using python

I am trying to connect a remote machine in python. I used telnetlib module and could connect to machine after entering login id and password as tn = Telnet("HOST IP") tn.write("UID") tn.write("PWD") After entering password, the terminal connects to…
user2033758
  • 1,848
  • 3
  • 16
  • 16