I don't know why my test example does not work. I am able to connect using ssh ssh@10.0.1.13 -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
I don't know why my test example does not work. I am able to connect using
ssh ssh@10.0.1.13 -p 2222from a terminal window on arch linux, after hitting enter for password, and inputecho hellothat 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.I also tried adding
load_system_host_keys=Falsebut that resulted in the following error: