user1360367
user1360367

Reputation: 37

Paramiko SSHException Channel Closed

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.

Upvotes: 3

Views: 5273

Answers (1)

cybertoast
cybertoast

Reputation: 1423

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.

Upvotes: 3

Related Questions