As it is with passwords, one may also have multiple ssh keys on multiple pc’s. I use subdirs in the ssh folder to maintain multiple ssh keys. The following example examines this for my github ssh key.
Create a new key:
sandbox myuser$ ssh-keygen -t rsa -C "Github - <my-mail-address>" Generating public/private rsa key pair. Enter file in which to save the key (/home/myuser/.ssh/id_rsa): /home/myuser/.ssh/github/id_rsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/myuser/.ssh/github/id_rsa. Your public key has been saved in /home/myuser/.ssh/github/id_rsa.pub. The key fingerprint is: ... The key's randomart image is: ...
Configure SSH daemon to automatically use the created key for github.com access:
Host github.com Hostname github.com User git PreferredAuthentications publickey IdentityFile ~/.ssh/github/id_rsa
Test github access:
ssh -T [email protected]