Skip to content

Instantly share code, notes, and snippets.

@binarymatt
Created January 26, 2011 19:49
Show Gist options
  • Save binarymatt/797304 to your computer and use it in GitHub Desktop.
Save binarymatt/797304 to your computer and use it in GitHub Desktop.
def sshagent_run(cmd):
"""
Helper function.
Runs a command with SSH agent forwarding enabled.
Note:: Fabric (and paramiko) can't forward your SSH agent.
This helper uses your system's ssh to do so.
"""
host = api.env.host_string
result = api.local('ssh -A %s "%s"' % (host, cmd))
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment