Skip to content

Instantly share code, notes, and snippets.

@pichuang
Created June 12, 2014 14:06
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 pichuang/ce3d77945d4355e7c3ad to your computer and use it in GitHub Desktop.
Save pichuang/ce3d77945d4355e7c3ad to your computer and use it in GitHub Desktop.
Auto load ssh_key
#Auto load ssh_key & ssh-agent
#Add ~/.bashrc
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s` > /dev/null 2>&1
ls ~/.ssh/ |grep -vE '(.pub|authorized_keys|known_hosts)'| xargs -i ssh-add ~/.ssh/{} > /dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment