Skip to content

Instantly share code, notes, and snippets.

@copperlight
Created August 11, 2016 16:27
Show Gist options
  • Save copperlight/e9eaa40d6f3bb9e1e6e6b1dd8ba0a8d5 to your computer and use it in GitHub Desktop.
Save copperlight/e9eaa40d6f3bb9e1e6e6b1dd8ba0a8d5 to your computer and use it in GitHub Desktop.
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
else
export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
fi
if [ "$(ssh-add -l)" == "The agent has no identities." ]; then
ssh-add
fi
@gomker
Copy link

gomker commented Jul 5, 2018

FYI this is broken in in 18.04 Ubuntu on Windows 10 WSL
microsoft/WSL#3183

@beeven
Copy link

beeven commented Jul 9, 2018

@gomker Fixed in Windows 10 build 17711. But characters not in ASCII display as squares in this build. 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment