Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
ProxyCommand objects need the socket-like-obj _closed fix too #789
It only implements
Since it wraps a
The exception is gone, thanks!!
import paramiko import time import logging import os ssh_host='localhost' proxy_cmd='ssh -o StrictHostKeyChecking=no -W localhost:22 localhost' logging.basicConfig(level=logging.DEBUG) while True: logging.debug('running PID %s', os.getpid()) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh_proxy = paramiko.ProxyCommand(proxy_cmd) ssh.connect(sock=ssh_proxy, hostname=ssh_host) sftp = ssh.open_sftp() sftp.close() ssh.close() ssh_proxy.close() logging.debug('going to sleep') time.sleep(3)
Results in: (
The logs after authentication look like this:
I tried changing the 'close' method of ProxyCommand from:
Maybe I should use a different order of closing(i.e. sftp/ssh/proxy)?
Starting to wonder if I should investigate using Invoke's
Poking #811 now...
I also doublechecked and the impl of
Either way I don't think it should block the basic attribute-error-fixing commit from merging so I'm gonna do that and we can spin this discussion into a new ticket if it's still affecting you. Let me know. Thanks!
I'm running into the same problem using SSH Tunnel(Netcat on jumphost). I get
upstate = False
I applied the fix #798 in paramiko/proxy.py but im still getting this error. Any clue what should I do next?
from datetime import datetime
from paramiko.ssh_exception import ProxyCommandFailure