Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Forked from copperlight/.bashrc
Created August 14, 2018 05:52
Show Gist options
  • Save holmeszyx/1150d80c8d9990bd213dca70933dcb66 to your computer and use it in GitHub Desktop.
Save holmeszyx/1150d80c8d9990bd213dca70933dcb66 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
@holmeszyx
Copy link
Author

auto pass
PS="my_passphrase"
install -vm700 <(echo "echo $PS") $PWD/my_pass
DISPLAY= SSH_ASKPASS=$PWD/my_pass ssh-add - && rm -v my_pass

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