Paramiko SSHException Channel Closed

匿名 (未验证) 提交于 2019-12-03 00:59:01

问题:

I have been using Paramiko to send commands across on a Linux/Windows machine.

It is working fine for remotely executing tests on an Ubuntu machine. However, it doesn't work on the Windows 7 host machine.

Below is the error that I received:-

def _unit_for_event(self):   self_event.wait()   assert self.event.isSet()    if self.event_ready:     return   e = self.transport.get_exception()   if e is None:     e = SSHException ('Channel closed.')   raise e 

The exception was:

E SSHException: Channel closed. 

I am using the latest Paramiko version 1.7.7.1 and installing Open SSHd on the Windows 7 machine.

Has anyone had a similar experience to the above? This error is not seen when I remotely execute on a Linux machine.

回答1:

In my case this turned out to be due to SFTP being misconfigured on the server. Try sftp user@remote-host and if that does not work you'll know that's the root cause. Fixing the problem is dependent on what your server is.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!