ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(NODE, username=SETTINGS['username'], password=SETTINGS['password'])
当我尝试使用paramiko进行ssh时,有人能告诉我这个错误意味着什么吗?
Traceback (most recent call last):\r\n
File "/path/stats.py", line 104, in connect\r\n
ssh.connect(NODE, username=SETTINGS['username'], password=SETTINGS['password'])\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/client.py", line 367, in connect\r\n
look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/client.py", line 558, in _auth\r\n
key = pkey_class.from_private_key_file(filename, password)\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/pkey.py", line 184, in from_private_key_file\r\n
key = cls(filename=filename, password=password)\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/ecdsakey.py", line 49, in __init__\r\n
self._from_private_key_file(filename, password)\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/ecdsakey.py", line 146, in _from_private_key_file\r\n
self._decode_key(data)\r\n
File "/usr/software/lib/python3.2/site-packages/paramiko-1.16.0-py3.2.egg/paramiko/ecdsakey.py", line 161, in _decode_key\r\n
key = SigningKey.from_der(data)\r\n
File "/usr/software/lib/python3.2/site-packages/ecdsa-0.13-py3.2.egg/ecdsa/keys.py", line 178, in from_der\r\n
curve_oid, empty = der.remove_object(curve_oid_str)\r\n
File "/usr/software/lib/python3.2/site-packages/ecdsa-0.13-py3.2.egg/ecdsa/der.py", line 82, in remove_object\r\n
raise UnexpectedDER("wanted object (0x06), got 0x%02x" % n)\r\n
ecdsa.der.UnexpectedDER: wanted object (0x06), got 0x30\r\n
答案 0 :(得分:0)
虽然我不确定为什么会这样,但我可以通过将look_for_keys=False
传递给connect()
来解决这个问题。