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
1
vote
2 answers

How to programatically add cron job via telnet?

I have Machine-1 and Machine-2 connected via LAN. I want to create a program that see if number of jobs scheduled in Machine-1 exceeds certain limit then to schedule upcoming jobs in Machine-2 so to avoid overhead from single machine. Both Machines…
MD Danish
  • 179
  • 1
  • 10
1
vote
0 answers

Why Can't change a GUI text while using telnetlib In Python

I'm trying to make my first program in Python. It's a program for remote shutdown using telnet. The code works ok when output is set to console, but I'm trying to make a little interface using tkinter. A button and a scroll text box. I can't do a…
asch75
  • 43
  • 3
1
vote
1 answer

How can I make two telnet instances interact with each other?

My goal is to have two telnet clients that pipe data to eachother, via python. I have manually connected one telnet client to my TeamSpeak server. The other telnet client is connected to an IRC server. How can I bridge / pipe them, using python? My…
Khailz
  • 89
  • 1
  • 12
1
vote
2 answers

Python reading until null character from Telnet

I am telneting to my server, which answers to me with messages and at the end of each message is appended hex00 (null character) which cannot be read. I tried searching through and through, but can't seem to make it work, a simple example: from…
brian
  • 509
  • 3
  • 14
1
vote
1 answer

Find and remove a Python object from locals() or globals()

I'm using telnetlib to communicate with some equipment which has Telnet implemented as single user. Therefore, I have to detect and remove the telnet object created from a previous attempt to establish communication.(Ex: tn =…
flamenco
  • 2,702
  • 5
  • 30
  • 46
1
vote
1 answer

Telnet output parsing

I'm now trying to work with telnetlib in Python 3.4. All I want is to try send command to my access point and get some response. My code: `import telnetlib import time user='admin' password='admin' host='192.168.1.1' try: …
Qwerty
  • 83
  • 2
  • 8
1
vote
1 answer

Multi-threading IO

I am trying to make an interactive telnet client for Ruby. The current library is extremely lacking so I have been trying to add onto it by creating an interactive gem that allows a user to streamline data in real time with telnet. To do this I need…
chopper draw lion4
  • 12,401
  • 13
  • 53
  • 100
1
vote
1 answer

How to print out the output of "tar" execution until it finishes using telnetlib?

I tried to print out as 'tar' command extracts files, but I can't print out the output of the progress. import telnetlib tn = telnetlib.Telnet("x.x.x.x") tn.write("tar -xvf a.tar") print tn.read_until("#") time.sleep(1800) Above code prints out…
spark
  • 531
  • 6
  • 17
1
vote
2 answers

Why won't this code work in python but when I telnet It does?

What I am trying to do it make a GUI to control a raspberry pi bot. I have telnet to wirelessly connect to it. When I telnet to it from a terminal on my computer, I can run echo 1=230 > /dev/servoblaster to make one of the servos move. However, when…
Kian Cross
  • 1,818
  • 2
  • 21
  • 41
1
vote
1 answer

How to bind an ip address to telnetlib in Python

The code below binds an ip address to urllib, urllib2, etc. import socket true_socket = socket.socket def bound_socket(*a, **k): sock = true_socket(*a, **k) sock.bind((sourceIP, 0)) return sock socket.socket = bound_socket Is it also…
jack
  • 17,261
  • 37
  • 100
  • 125
1
vote
3 answers

Python telnetlib and console connection cisco node

I am trying to connect to the console connection of a cisco node via a cisco terminal/comm server. To do this I telnet to the IP-address of the cisco terminal/comm server on a specific port let us say X.X.X.X - port 2068. When I am doing this from…
user3733560
  • 13
  • 1
  • 3
1
vote
0 answers

Multiple Python telnet write and read commands without timer?

while True: command = raw_input("=> ") if command == 'Exit': tn.write(command + "\r\n") time.sleep(1) tn.close() break tn.write(command + "\r\n") time.sleep(2) print tn.read_very_eager() I've established a…
1
vote
2 answers

telnetlib write() function not executing lengthy commands

I am trying to use telnetlib to send commands to a device. The following is the command I am using: tn = telnetlib.Telnet("10.62.48.96") tn.write('c:/Test/Minte/TE.exe c:/data/test/bin/Test.dll >> c:/test/test.log \r\n') print…
Shesh
  • 11
  • 3
1
vote
2 answers

Python telnetlib read_until spams my server

I'm using telnet lib to read from an Telnet server. my code looks like this: s = telnetlib.Telnet(self.host, self.port) while 1: line = s.read_until("\n") print(line) this is working fine so far, but as i have a look on the network…
Vinzens
  • 21
  • 1
1
vote
0 answers

telnet works,but python telnetlib fails

I am trying to telnet into a altusen power KVM and reboot a computer. when doing this using the windows telnet it works great. but when I use python's telnetlib, all read commands fail (not immediately but on timeout) again when using the windows…
Rincewind
  • 31
  • 6