Fwd: Can paramiko keep a ssh connection ?
- Jeff Forcier
- 2014-01-20 @ 07:16
(Re-sending to the ML...)
You probably want to activate SSH's 'Keep-Alive' feature on the Transport class:
You can see how Fabric does it here:
Should be able to replicate that on your end; 'client' is just the
SSHClient instance, and replace 'env.keepalive' with an integer (in
seconds) of your choice.
On Sun, Jan 19, 2014 at 12:53 AM, 相勇 <email@example.com> wrote:
> Sorry I didn't subscribe maillist before , subscribed and confirmed just
> 2014/1/19 相勇 <firstname.lastname@example.org>
>> Hi, jeff & everybody :
>> I'm using paramiko 1.11.0. As all known if I ssh a server and don't do
>> any operation for a long time, the server will disconnect the connection
>> between us. So my question is can paramiko keep a ssh connection ?
>> for example :
>> I connected remote server by paramiko successfully , then
>> time.sleep(some seconds) on my terminal , then exec_command with the object
>> I've instanced . Should I check if the connection is closed before I use the
>> object ? Or the object can keep connection by itself ?
>> Thanks and Best Wishes !
Unix sysadmin; Python/Ruby engineer
Unix sysadmin; Python/Ruby developer