I am trying to set up a ssh connection through paramiko, using a proxy.
Considering the following code:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
sock = paramiko.ProxyCommand('ssh user@proxy_host nc host 22')
ssh.connect(host, username='my_username',sock=sock)
stdin,stdout,stderr = ssh.exec_command("ls .")
ssh.close()
Under cygwin it works just fine. On the same machine, under Windows 8.1 it gives:
No handlers could be found for logger "paramiko.transport"
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\user\Anaconda\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 1673, in run
self.sock.close()
File "build\bdist.win-amd64\egg\paramiko\proxy.py", line 110, in close
os.kill(self.process.pid, signal.SIGTERM)
WindowsError: [Error 5] Access is denied
Traceback (most recent call last):
File ".\test_python_ssh.py", line 14, in <module>
ssh.connect(host, username='my_username',sock=sock)
File "build\bdist.win-amd64\egg\paramiko\client.py", line 324, in connect
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 406, in start_client
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner(10038, 'An operation was attempted on something t
hat is not a socket')
Any ideas how to solve the situation?
I wasn't sure if it is a stackoverflow question or superuser, but in case, just let me know.
Aucun commentaire:
Enregistrer un commentaire