Created
April 27, 2013 15:16
-
-
Save ophentis/5473449 to your computer and use it in GitHub Desktop.
setting multiple private key for ssh
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
1. | |
ssh-keygen -t rsa -f ~/.ssh/id_rsa.work -C "Key for Word stuff" | |
2. | |
touch ~/.ssh/config | |
chmod 600 ~/.ssh/config | |
echo "IdentityFile ~/.ssh/id_rsa.work" >> ~/.ssh/config | |
echo "IdentityFile ~/.ssh/id_rsa.misc" >> ~/.ssh/config | |
3. more detailed config (default to ~/.ssh/id_dsa or ~/.ssh/id_rsa if no match) | |
Host *.home | |
IdentityFile ~/.ssh/id_dsa.home | |
User king123 | |
Host *.vpn | |
IdentityFile ~/.ssh/id_rsa.work | |
User yaya | |
Port 2222 | |
Host *.vm | |
IdentityFile ~/.ssh/id_rsa.vm | |
User whatisup | |
Port 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment