I have python script: Using telnet it connects to remote host via telnet and simply executing command. It works fine with one host, but If i want using function to connect to 4+ hosts it maybe from 4-5 try sends only one random.
def main():
usr = "adm"
ip = "192.168.5.15"
pwd = "123456"
command = "tftp ......" (works fine)
com(ip,usr,pwd,command)
def com(host,usr,pwd,comm):
HOST=host
user=usr
password=pwd
command = comm
try:
telnet = telnetlib.Telnet(HOST)
telnet.read_until(b"Username:")
telnet.write(user.encode('ascii') + b"\n")
same for password
telnet.write(command.encode('ascii') + b"\n")
telnet.close()
except:
pass
main()
Are there any limits for telnet connections in python or something that can limit number of sending files or anything?