paramiko.connect()得到了一个意外的关键字参数'auth_timeout'

时间:2017-11-20 14:31:03

标签: python paramiko

尝试在代码下面运行:

try:
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(device, username='username', password='password', look_for_keys=False, allow_agent=False, timeout=None, auth_timeout=60.0 )
    remote_conn = ssh.invoke_shell()
    output = remote_conn.recv(65535)
    print("connection established to %s" % device)
except IOError as error:
    print("connecting to device %s failed." % device)
    print error
except paramiko.AuthenticationException as error:
    print("connecting to device %s failed." % device)
    print error 
except Exception as error:
    print("connecting to device %s failed." % device)
    print error

得到以下提到的错误:

connect()得到了一个意外的关键字参数'auth_timeout'

参考:

http://docs.paramiko.org/en/2.4/api/client.html

0 个答案:

没有答案