我的网络中有两个桌面,我安装了Cygwin并启动了sshd服务。使用paramiko我通过一台计算机通过sftp成功发送和接收文件。但是对于另一个我收到以下错误消息:
Traceback (most recent call last):
File "C:\Neptune_Step_2015\Tests\SVTestcases\TC-Regression\netadmin.py", line 37, in <module>
tc.receive_file_from_desktop()
File "C:\Neptune_Step_2015\Tests\SVTestcases\Common/shared\testCaseBase.py", line 258, in receive_file_from_desktop
sftp = ssh.open_sftp()
File "C:\Python27\lib\site-packages\paramiko\client.py", line 379, in open_sftp
return self._transport.open_sftp_client()
File "C:\Python27\lib\site-packages\paramiko\transport.py", line 811, in open_sftp_client
return SFTPClient.from_transport(self)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 132, in from_transport
return cls(chan)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 101, in __init__
raise SSHException('EOF during negotiation')
**paramiko.ssh_exception.SSHException: EOF during negotiation**
两台机器运行的代码绝对相同,如下所示:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
ssh.connect(self.ftpipaddress,username = self.ftpuserName,password = self.ftppwd)
#sftp = paramiko.SFTPClient.from_transport(trans) //Tried this too, did not work
sftp = ssh.open_sftp()
我正在考虑可能性:
$ cygrunsrv --verbose -Q sshd
Service : sshd
Display name : CYGWIN sshd
Current State : Running
Controls Accepted : Stop
Command : /usr/sbin/sshd -D
stdin path : /dev/null
stdout path : /var/log/sshd.log
stderr path : /var/log/sshd.log
Environment : CYGWIN="ntsec"
Process Type : Own Process
Startup : Automatic
Dependencies : tcpip
Account : .\cyg_server