Last Updated: February 25, 2016
·
10.79K
· mrallen1

Persist keys in ssh-agent on OS X

On OS X you can persist keys in ssh-agent by storing them in the built in "Keychain" application by using the -K option to ssh-add

ssh-add -K /path/to/key

Be aware there are some special caveats if you're using password protected SSH keys from older installations of OpenSSH (like on a previous version of OS X) when doing this on Mavericks. This Stack Exchange question covers the issue and has a solution.

2 Responses
Add your response

Actually, make sure you /usr/bin/ssh-add -K. E.g. you can have brew's version of OpenSSH and still use usr/bin/ssh-add -K to add a key to the system's keychain

over 1 year ago ·

Thx a lot gpa. I thought going crazy... but I dont undertand why ssh-add doesn't add permanently...

over 1 year ago ·