Created
November 25, 2019 21:54
-
-
Save sdemjanenko/4212cae4fe8f08b73a0823db8d8f86c3 to your computer and use it in GitHub Desktop.
WSL Ubuntu SSH agent socket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SSH_AUTH_SOCK=~/.ssh/ssh-agent.$HOSTNAME.sock | |
agent_count=`ps -C ssh-agent --no-headers | wc -l`; | |
if [ "$agent_count" = 0 ]; then | |
rm -f $SSH_AUTH_SOCK | |
fi | |
ssh-add -l 2>/dev/null >/dev/null | |
if [ $? -ge 2 ]; then | |
ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment