我正在嘗試使用 python 連接在 Windows 中運行的虛擬 CentOS 機器之一。我已經安裝了 paramiko 模塊來做到這一點。但低于錯誤C:\Users\xxxx\PycharmProjects\xxxx\venv\lib\site-packages\paramiko\kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding. m.add_string(self.Q_C.public_numbers().encode_point())C:\Users\xxx\PycharmProjects\xxxx\venv\lib\site-packages\paramiko\kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point self.curve, Q_S_bytesC:\Users\xxxx\PycharmProjects\xxxx\venv\lib\site-packages\paramiko\kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding. hm.add_string(self.Q_C.public_numbers().encode_point())下面是我的代碼:import paramikossh = paramiko.client.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())try: ssh.connect('10.xx.xx.xxx', username='root', password='xxxxx')except paramiko.SSHException: print("Connection Failed") quit()stdin, stdout, stderr = ssh.exec_command("ls /etc/")for line in stdout.readlines(): print line.strip()ssh.close()我使用PyCharm 2018.3 社區版搜索并安裝了密碼學 2.6.1,python 版本 3.7.1。請讓我知道我在這里做錯了什么
添加回答
舉報
0/150
提交
取消