Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Commands using agent forwarding hang #399
Version 1.15.0 introduced a regression with ssh agent forwarding which causes commands to hang when they use the forwarded agent. This bug wasn't present in version 1.14.1
We were experiencing this problem with fabric, which can be reproduced with the following script executed with
from fabric.api import run, env env.forward_agent = True def test(): run('ssh-add -L')
Fabric is using
import sys import paramiko host = sys.argv client = paramiko.SSHClient() client.load_system_host_keys() client.connect(host) channel = client.get_transport().open_session() forward = paramiko.agent.AgentRequestHandler(channel) channel.exec_command('ssh-add -L') stdout = channel.makefile('r') stderr = channel.makefile_stderr('r') for line in stdout: sys.stdout.write(line) for line in stderr: sys.stderr.write(line) channel.close() forward.close() client.close()
The regression came when resolving merge conflicts in that merge commit. The problem is that Transport.init changed the position of the gss_kex and gss_deleg_creds arguments, and SSHClient.connect constructs a Transport with positional arguments for gss_kex and gss_deleg_creds.
I'll write a pull request that creates the Transport with keyword arguments.