From 9033e060727fe5254f6fb1c1f23b99dec4a38e2c Mon Sep 17 00:00:00 2001 From: ltz3317 <454629049@qq.com> Date: Sat, 26 Dec 2020 15:52:59 +0800 Subject: [PATCH 1/3] Update settings.py --- webssh/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/webssh/settings.py b/webssh/settings.py index c9dbbbe3..c5e12a5e 100644 --- a/webssh/settings.py +++ b/webssh/settings.py @@ -44,6 +44,7 @@ def print_version(flag): '*': wildcard policy, matches any domain, allowed in debug mode only.''') define('wpintvl', type=float, default=0, help='Websocket ping interval') define('timeout', type=float, default=3, help='SSH connection timeout') +define('auth_timeout', type=int, default=120, help='SSH connection auth timeout') define('delay', type=float, default=3, help='The delay to call recycle_worker') define('maxconn', type=int, default=20, help='Maximum live connections (ssh sessions) per client') From 074302da46e644f015bba0d33ef34ad6384538d4 Mon Sep 17 00:00:00 2001 From: ltz3317 <454629049@qq.com> Date: Sat, 26 Dec 2020 15:54:24 +0800 Subject: [PATCH 2/3] Update handler.py --- webssh/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webssh/handler.py b/webssh/handler.py index 9b65d1da..0470cf57 100644 --- a/webssh/handler.py +++ b/webssh/handler.py @@ -446,7 +446,7 @@ def ssh_connect(self, args): logging.info('Connecting to {}:{}'.format(*dst_addr)) try: - ssh.connect(*args, timeout=options.timeout) + ssh.connect(*args, timeout=options.timeout, auth_timeout=options.auth_timeout,) except socket.error: raise ValueError('Unable to connect to {}:{}'.format(*dst_addr)) except paramiko.BadAuthenticationType: From 5be03fdc402f6f19eda3fed3843b308de03d04e1 Mon Sep 17 00:00:00 2001 From: ltz3317 <454629049@qq.com> Date: Sat, 26 Dec 2020 16:00:42 +0800 Subject: [PATCH 3/3] Update handler.py paramiko default auth timeout 30s. AIX certification often takes more than a minute. --- webssh/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webssh/handler.py b/webssh/handler.py index 0470cf57..3558540d 100644 --- a/webssh/handler.py +++ b/webssh/handler.py @@ -446,7 +446,7 @@ def ssh_connect(self, args): logging.info('Connecting to {}:{}'.format(*dst_addr)) try: - ssh.connect(*args, timeout=options.timeout, auth_timeout=options.auth_timeout,) + ssh.connect(*args, timeout=options.timeout, auth_timeout=options.auth_timeout) except socket.error: raise ValueError('Unable to connect to {}:{}'.format(*dst_addr)) except paramiko.BadAuthenticationType: