How to set default ssh key to log in to a server - kdaisho/Blog GitHub Wiki

I included the path for the ssh key every time I log in to the server.

ssh -i ~/.ssh/my_private_key_name [email protected]

But once you run this command, your computer treats the ssh key as default.

The key is --apple-use-keychain, and as the name indicates, it only works for OSX.

ssh-add --apple-use-keychain my_private_key_name

After that, you won't need to include the path for the ssh key to log in to the server anymore.

ssh [email protected]