Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paramiko.ssh_exception.SSHException: Channel closed. #89

Open
frankgould opened this issue Feb 26, 2020 · 0 comments
Open

paramiko.ssh_exception.SSHException: Channel closed. #89

frankgould opened this issue Feb 26, 2020 · 0 comments

Comments

@frankgould
Copy link

I don't know why my test example does not work. I am able to connect using ssh [email protected] -p 2222 from a terminal window on arch linux, after hitting enter for password, and input echo hello that works. I get the same error results when running it as a python app (i.e. python ssh_android.py) from the same terminal window. I have tried all kinds of combinations but nothing I've tried has worked.

Python 3.8.1 (default, Jan 25 2020, 17:00:07)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import spur
shell=spur.SshShell(hostname="10.0.1.13", port=2222, username="ssh", password="", shell_type=spur.ssh.ShellTypes.minimal)
with shell:
... result=shell.spawn(["echo","hello"], allow_error=True)
...
Traceback (most recent call last):
File "", line 2, in
File "/home/fgould/.local/lib/python3.8/site-packages/spur/ssh.py", line 186, in spawn
channel.exec_command(command_in_cwd)
File "/home/fgould/.local/lib/python3.8/site-packages/paramiko/channel.py", line 72, in _check
return func(self, *args, **kwds)
File "/home/fgould/.local/lib/python3.8/site-packages/paramiko/channel.py", line 257, in exec_command
self._wait_for_event()
File "/home/fgould/.local/lib/python3.8/site-packages/paramiko/channel.py", line 1226, in _wait_for_event
raise e
paramiko.ssh_exception.SSHException: Channel closed.

I also tried adding load_system_host_keys=False but that resulted in the following error:

Server '[10.0.1.13]:2222' not found in known_hosts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant