Skip to content

Instantly share code, notes, and snippets.

@abehmiel
Created July 28, 2017 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abehmiel/4bd8560a6471f5b85d3700976ea1c06c to your computer and use it in GitHub Desktop.
Save abehmiel/4bd8560a6471f5b85d3700976ea1c06c to your computer and use it in GitHub Desktop.
Prompt for ssh-auth on the first time using terminal after reboot (add to .bashrc)
# from https://unix.stackexchange.com/questions/90853/how-can-i-run-ssh-add-automatically-without-password-prompt
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment