我在 GCE 上使用 python 设置一个进程,该进程必须连接到我的本地 SFTP 并从那里复制文件。
我正在使用 pysftp 但遇到 SSH 问题。我究竟做错了什么?
>>> import pysftp
>>> sftp = pysftp.Connection(host, username=user, password=pasw)
Exception AttributeError: "'Connection' object has no attribute '_sftp_live'" in <bound method Connection.__del_
_ of <pysftp.Connection object at 0x7feaa86c5b90>> ignored
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pysftp/__init__.py", line 132, in __init__
self._tconnect['hostkey'] = self._cnopts.get_hostkey(host)
File "/usr/local/lib/python2.7/dist-packages/pysftp/__init__.py", line 71, in get_hostkey
raise SSHException("No hostkey for host %s found." % host)
paramiko.ssh_exception.SSHException: No hostkey for host sftp.mynet.com found.