Skip to content

Instantly share code, notes, and snippets.

@jodell
Created February 16, 2011 16:45
Show Gist options
  • Save jodell/829688 to your computer and use it in GitHub Desktop.
Save jodell/829688 to your computer and use it in GitHub Desktop.
# Automagic agent forwarding in remote screen sessions
#
# From http://superuser.com/questions/180148/how-do-you-get-screen-to-automatically-connect-to-the-current-ssh-agent-when-re-a
# In ~/.ssh/rc
#!/bin/bash
if test "$SSH_AUTH_SOCK" ; then
ln -sfv $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
## In ~/.screenrc
setenv SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment