I have multiple SSH keys – I prefer to use a unique one for each client. However, when you add a key to the SSH client with
1 |
ssh-add |
it only persists for as long as the client is running if you didn’t add the SSH key to Keychain when you first used it – if you reboot frequently (which I don’t normally, but since I bootcamped, I do more often) that key is lost and needs to be added each time.
Adding it to the keychain at the same time is as simple as using the -K switch:
1 |
ssh-add -k /path/to/your/key |
Usually keys are stored in the .ssh directory for your user
1 |
ssh-add -k ~/.ssh/id_rsa_mykey |
assuming the key is named id_rsa_mykey, which is the format I use. Note it is the private keyfile you add, not the public one (id_rsa_mykey.pub)