I have SSH keys installed on OSX Mavericks installed at ~/.ssh/

Everytime I want to SSH to a server from Terminal, I need to do the following:

eval `ssh-agent -s`
ssh-add ~/.ssh/example_rsa

If I open a new Terminal window, and try typing ssh-add ~/.ssh/example_rsa it just fails. I need to use the eval 'ssh-agent -s' step every single time first, then I can add with ssh-add and then use that to SSH to my required destination.

Prior, when I had OS X Mountain Lion I did not have to do this more than once. I just added the SSH keys, and away I went.

When programs like GitHub do their magic, it always works, using it's own SSH keys. It also works if I use Git from the Terminal. Only when I want to SSH to a server using that specific key.

Granted, it does have a password on it.

This is the privileges on the folders:

700 ~/.ssh
600 ~/.ssh/authorized_keys
600 ~/.ssh/example_rsa
644 ~/.ssh/example_rsa.pub

If any light could be shed on this, I would be extremely grateful. A number of my keys that I generated have got the passwords on them, and it's a pain to keep finding their respective passwords and type it in every time I want to SSH with them.

I use the exact same keys from CentOS, Debian, Ubuntu - all have no problems once I've added them once. Never need to do it again. Only since I moved to Mavericks (clean install).


I know it does not answer your question directly, but have you tried using a config file to map you keys to servers?

in .ssh create a file called config In the file put your server entries and map the key

Host server1
User myUser
IdentityFile ~/.ssh/id_rsa

then you can just run ssh server1


You can add the private key file path to the '~/.ssh/config' file

Login will automatically match

IdentityFile ~/.ssh/example1_rsa
IdentityFile ~/.ssh/example2_rsa
IdentityFile ~/.ssh/example3_rsa

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .