Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SSH Use Specific Private Key

If you have multiple SSH keys generated for different purposes (one for GitHub, one for server administration, etc...) you can specify which private key to use via config.

In ~/.ssh/config you may have the following:

host github.com
 HostName github.com
 IdentityFile ~/.ssh/id_rsa.github
 User <your PC user name (not GitHub user name)>

host digitalocean
  HostName <your server IP>
  IdentityFile ~/.ssh/id_rsa.digitalocean
  User <your server user name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.