无论我用 DSA 还是 RSA 都会得到认证失败的异常
dsa 的时候我也有生生成 id_dsa
In [1]: import paramiko
In [2]: ssh = paramiko.SSHClient()
In [3]: ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
In [4]: key_file = paramiko.DSSKey.from_private_key_file('/root/.ssh/id_dsa')
In [5]: ssh.connect('192.168.1.117',22,'root',pkey=key_file)
---------------------------------------------------------------------------
AuthenticationException Traceback (most recent call last)
in ()
----> 1 ssh.connect('192.168.1.117',22,'root',pkey=key_file)
~/virtualenv/skops/lib/python3.6/site-packages/paramiko/client.py in connect(self, hostname, port, username, password, pkey, key_filename, timeout, allow_agent, look_for_keys, compress, sock, gss_auth, gss_kex, gss_deleg_creds, gss_host, banner_timeout, auth_timeout, gss_tr