Multiple private keys client setup

August 02, 2018

ssh
private key
bash
configuration

To use multiple shh private keys on a client you need to create the file config inside the folder .ssh and use the following entries:

Host myshortname realname.example.com
HostName realname.example.com
IdentityFile ~/.ssh/realname_rsa
User remoteusername

Host myother realname2.example.org
HostName realname2.example.org
IdentityFile ~/.ssh/realname2_rsa
User remoteusername

where IdentityFile is the private key for realname.


Written by huckbit web developer who lives and works in UK building cool things. You can find me on twitter.