diff --git a/webssh/handler.py b/webssh/handler.py index 9b65d1da..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) + 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: 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')