Skip to content

Instantly share code, notes, and snippets.

@coalwater
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coalwater/e8bf9cc9acf65d6e656d to your computer and use it in GitHub Desktop.
Save coalwater/e8bf9cc9acf65d6e656d to your computer and use it in GitHub Desktop.
Using different ssh keys for different hosts
Host vps1
IdentityFile ~/.ssh/vps1
Port 5432
Hostname 11.22.33.44
User root
Host vps2
IdentityFile ~/.ssh/vps2
Port 22
Hostname 12.34.56.78
User vpsuser
Host myVps
IdentityFile ~/.ssh/vps
Port 5432
Hostname 11.22.33.44
User root
Host [name]
IdentityFile [path_to_private_key]
Port [ssh_port_number]
Hostname [actual_server_address_or_hostname]
User [ssh_connection_user]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment