Solution: Requires string as left operand, not bytes telnetlib

Development | Programming languages
Description
Requires string as left operand, not bytes telnetlib
Attachments
No attachments
Solutions
Description
Insert py code pls
on February 11th, 2020 (9:13 pm)
Description
import sys
import telnetlib
target = "192.168.0.10"
telnet_port=22
telnetObj = telnetlib.Telnet(target, telnet_port, timeout=10)
telnetObj.write("exit")
print(telnetObj.read_all())

on February 11th, 2020 (9:18 pm)
Description
Replace code:

From
telnetObj.write("exit")

To
telnetObj.write(b"exit\n")

on February 11th, 2020 (9:21 pm)
Description
Super, it works.
on February 11th, 2020 (9:22 pm)
All coments
This solution has not been commented yet.
You must sign in to comment!! LOGIN
We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept