Skip to content

Instantly share code, notes, and snippets.

@qbein
Created November 23, 2011 12:02
Show Gist options
  • Save qbein/1388514 to your computer and use it in GitHub Desktop.
Save qbein/1388514 to your computer and use it in GitHub Desktop.
SSH Agent in Cygwin
export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l 2>&1 > /dev/null
if [ $? = 2 ]; then
# Exit status 2 means we could not add to agent
ssh-agent -s -a $SSH_AUTH_SOCK > /tmp/.ssh-script
./tmp/.ssh-script
echo $SSH_AGENT_PID > /tmp/.ssh-agent-pid
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment