In ~/.ssh/config
you can specify host aliases. For example, let's say you have two different keys you want to use for the same user living on the same host. You would do that in the following manner... (excerpt from ~/.ssh/config
)
Host localhost
User git
IdentityFile /home/systems/.ssh/id_rsa
Host myaliashost
HostName localhost
User git
IdentityFile /home/systems/.ssh/another_id_rsa
You can connect to the git
user living on localhost
using either key with the following ssh commands....
id_rsa
- commandssh git@localhost
another_id_rsa
-ssh git@myaliashost