M
mk
I have the following situation:
1.
self.conobj = paramiko.SSHClient()
self.conobj.connect(self.ip, username=self.username,
key_filename=self.sshprivkey, port=self.port, timeout=opts.timeout)
2. very slow SSH host that is hanging for 30+ seconds on key exchange.
The timeout in the options regards only a socket timeout, not further
stages of connection negotiation, so it doesn't work there.
Question: how can I do that? Use another threaded class? Is there some
other way?
Additional snag is SSHClient() is a class that internally uses threads.
How do I kill brutally its threads? Is there any way to do it?
Regards,
mk
1.
self.conobj = paramiko.SSHClient()
self.conobj.connect(self.ip, username=self.username,
key_filename=self.sshprivkey, port=self.port, timeout=opts.timeout)
2. very slow SSH host that is hanging for 30+ seconds on key exchange.
The timeout in the options regards only a socket timeout, not further
stages of connection negotiation, so it doesn't work there.
The timeout option in connect() is for the socket, not for the entire
operation. You are connected, so that timeout is no longer relevant.
You would probably have to wrap the transport.connect() method in a
timer to break out of this early.
Question: how can I do that? Use another threaded class? Is there some
other way?
Additional snag is SSHClient() is a class that internally uses threads.
How do I kill brutally its threads? Is there any way to do it?
Regards,
mk