diff options
author | vakarisz <vakarisz@yahoo.com> | 2022-03-22 12:10:38 +0200 |
---|---|---|
committer | Mike Salvatore <mike.s.salvatore@gmail.com> | 2023-03-02 13:29:45 -0500 |
commit | 32a3d33ca1c2d385954304a7a87186f574c780cc (patch) | |
tree | 9f3b730ffa23e9c144c2afb04078fcae43d3bc4f /paramiko/client.py | |
parent | 6379b018ac49b1e869f1248b1d6743d316b5a37b (diff) | |
download | paramiko-32a3d33ca1c2d385954304a7a87186f574c780cc.tar.gz |
Add timeout for opening an SSH channel
Diffstat (limited to 'paramiko/client.py')
-rw-r--r-- | paramiko/client.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/paramiko/client.py b/paramiko/client.py index 5667d7e7..a9e4e233 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -233,6 +233,7 @@ class SSHClient(ClosingContextManager): gss_host=None, banner_timeout=None, auth_timeout=None, + channel_timeout=None, gss_trust_dns=True, passphrase=None, disabled_algorithms=None, @@ -311,6 +312,8 @@ class SSHClient(ClosingContextManager): for the SSH banner to be presented. :param float auth_timeout: an optional timeout (in seconds) to wait for an authentication response. + :param float channel_timeout: an optional timeout (in seconds) to wait + for a channel open response. :param dict disabled_algorithms: an optional dict passed directly to `.Transport` and its keyword argument of the same name. @@ -401,6 +404,8 @@ class SSHClient(ClosingContextManager): t.banner_timeout = banner_timeout if auth_timeout is not None: t.auth_timeout = auth_timeout + if channel_timeout is not None: + t.channel_timeout = channel_timeout if port == SSH_PORT: server_hostkey_name = hostname |