Use multiple SSH keys on one client
Save from hassles when accessing remote servers(like Github)
▶ avoid from re-entering username/passwd mutiple times with *HTTPS*
-
Generete SSH key
ssh-keygen -t rsa -f ~/.ssh/nux.github.id_rsa -C "nuxlee92@gmail.com"
-
Create/Update
vi ~/.ssh/config
Host personal/company # alias of HostName HostName github.com User git IdentityFile ~/.ssh/nux.github.id_rsa
-
Add generated public key to Github (remote server)
pbcopy < ~/.ssh/nux.github.id_rsa.pub
-
Clone the repo with configured Host
git clone git@personal:n-u-x/testssh.git
-
Set the right author if necessary
git config user.name <username> git config user.email <email>