@@ -61,6 +61,7 @@ def __init__(self, host,
61
61
_auth_thread_pool = True , keepalive_seconds = 60 ,
62
62
identity_auth = True ,
63
63
ipv6_only = False ,
64
+ keyboard_interactive = False ,
64
65
):
65
66
"""
66
67
:param host: Host name or IP to connect to.
@@ -107,6 +108,8 @@ def __init__(self, host,
107
108
for the host or raise NoIPv6AddressFoundError otherwise. Note this will
108
109
disable connecting to an IPv4 address if an IP address is provided instead.
109
110
:type ipv6_only: bool
111
+ :param keyboard_interactive: (Optional) Set to True to enable authentication as keyboard-interactive
112
+ :type keyboard_interactive: bool
110
113
111
114
:raises: :py:class:`pssh.exceptions.PKeyFileError` on errors finding
112
115
provided private key.
@@ -119,6 +122,7 @@ def __init__(self, host,
119
122
self .alias = alias
120
123
self .host = host
121
124
self .port = port if port is not None else 22
125
+ self .keyboard_interactive = keyboard_interactive
122
126
if proxy_host is not None :
123
127
_port = port if proxy_port is None else proxy_port
124
128
_pkey = pkey if proxy_pkey is None else proxy_pkey
@@ -260,7 +264,10 @@ def _pkey_from_memory(self, pkey_data):
260
264
)
261
265
262
266
def _password_auth (self ):
263
- self .session .userauth_password (self .user , self .password )
267
+ if self .keyboard_interactive :
268
+ self .session .userauth_keyboardinteractive (self .user , self .password )
269
+ else :
270
+ self .session .userauth_password (self .user , self .password )
264
271
265
272
def _open_session (self ):
266
273
chan = self ._eagain (self .session .open_session )
0 commit comments