def _try_passwordless_paramiko(server, keyfile):
 if (paramiko is None):
  msg = 'Paramiko unavaliable, '
  if (sys.platform == 'win32'):
   msg += 'Paramiko is required for ssh tunneled connections on Windows.'
  else:
   msg += 'use OpenSSH.'
  raise ImportError(msg)
 (username, server, port) = _split_server(server)
 client = paramiko.SSHClient()
 client.load_system_host_keys()
 client.set_missing_host_key_policy(paramiko.WarningPolicy())
 try:
  client.connect(server, port, username=username, key_filename=keyfile, look_for_keys=True)
 except paramiko.AuthenticationException:
  return False
 else:
  client.close()
  return True

def _try_passwordless_paramiko ( server , keyfile ) : if ( paramiko is None ) : msg = 'Paramiko unavaliable, ' if ( sys . platform == 'win32' ) : msg += 'Paramiko is required for ssh tunneled connections on Windows.' else : msg += 'use OpenSSH.' raise ImportError ( msg ) ( username , server , port ) = _split_server ( server ) client = paramiko . SSHClient ( ) client . load_system_host_keys ( ) client . set_missing_host_key_policy ( paramiko . WarningPolicy ( ) ) try : client . connect ( server , port , username = username , key_filename = keyfile , look_for_keys = True ) except paramiko . AuthenticationException : return False else : client . close ( ) return True
try passwordless login with paramiko .