Created
June 12, 2014 14:06
-
-
Save pichuang/ce3d77945d4355e7c3ad to your computer and use it in GitHub Desktop.
Auto load ssh_key
This file contains 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
#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