Skip to content

Instantly share code, notes, and snippets.

@HereChen
Last active January 31, 2018 03:31
Show Gist options
  • Save HereChen/af9168023207b2c93876eb53fdd00abf to your computer and use it in GitHub Desktop.
Save HereChen/af9168023207b2c93876eb53fdd00abf to your computer and use it in GitHub Desktop.
add ssh on ubuntu start
# https://unix.stackexchange.com/questions/90853/how-can-i-run-ssh-add-automatically-without-password-prompt
$ sudo vim ~/.bashrc
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add -D
ssh-add ~/.ssh/id_rsa_oschina
ssh-add ~/.ssh/id_rsa_github
ssh-add -l
fi
# /git/etc/profile
# my own start script
# add ssh
# in git-bash: edit etc/profile, add followling to the last
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add -D
ssh-add ~/.ssh/id_rsa_gitlab
ssh-add ~/.ssh/id_rsa_github
ssh-add ~/.ssh/id_rsa_inter_gitlab
ssh-add ~/.ssh/id_rsa_gitee
ssh-add -l
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment