Automatically add keys to ssh agent in Mac OS without keeping passphrase in keychain

In Ubuntu, the default behavior is that the ssh client offers all keys present in ~/.ssh/ directory and when it finds a matching key it asks for its passphrase. The key remains unlocked in memory and I need to enter the password again if I reboot.

How can I get the same behavior in Mac OS?

1 Answer

Use

ssh-add

on the command line. It will keep your key(s) open until your mac goes to sleep, the screen gets locked, you logout or reboot. See

man ssh-add

for more use cases.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like