diff --git a/webssh/handler.py b/webssh/handler.py index 6cfc822..b3457c2 100644 --- a/webssh/handler.py +++ b/webssh/handler.py @@ -452,7 +452,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler): 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 b02b79e..b8f8897 100644 --- a/webssh/settings.py +++ b/webssh/settings.py @@ -44,6 +44,7 @@ separated by comma; '*': 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')