A
A
arma6662020-09-09 11:55:38
Python
arma666, 2020-09-09 11:55:38

Python paramiko. transport.accept not working?

Here is the code:

import paramiko

client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
    client.connect(
                '192.168.1.129',
                '22',
                username='root',
                key_filename=None,
                look_for_keys=False,
                password='1',
            )
except Exception as e:
    print("*** Failed to connect: ", e )
    sys.exit(1)

print('connected')
transport = client.get_transport()
print(transport) #<paramiko.Transport at 0x3d9d890 (cipher aes128-ctr, 128 bits) (active; 0 open channel(s))>
chain = transport.accept(1000)
print(chain)

Everything hangs on chain = transport.accept(1000). Doesn't throw an error, just hangs. If you wait 1000 seconds then print(chain) produces Null. I tried to connect to different hosts and from different hosts (win-lin) - the same thing.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question