


Passphrases in the user's keychain when attempting to use a par. On macOS, specifies whether the system should search for Checking the man page (via man ssh_config) shows the following info: UseKeychain UPDATE: Apple has now added a UseKeychain option to the open SSH config options and considers ssh-add -A a solution as well.Īs of macOS Sierra 10.12.2, Apple (I assume) has added a UseKeychain config option for SSH configs. That will allow the SSH key/identity to be reloaded to the SSH agent on each startup/reboot. bash_profile: nano ~/.bash_profileĪnd add this line to the bottom comment or remove the -A version if you have that in place: ssh-add -K 2>/dev/null If that’s all worked, type in ssh-add -l and you should see one lone SSH key/identity listed.Īll good? Now open up your. Type in your passphrase, hit Return and you should be good to go.īut in other cases simply running this is enough to get the key/identity added: ssh-add -K In some cases you can specifically add the ~/.ssh/id_rsa.pub key/identity to the agent like so: ssh-add ~/.ssh/id_rsa.pub Now, it gets weird and I am not too sure why. With that done, then start the SSH agent as a background process like so: eval "$(ssh-agent -s)" My solution after much testing was as follows.įirst, if you have more SSH keys/identities added to your agent than you need-as shown with ssh-add -l then purge them all from the agent like so: ssh-add -D The problem is that ssh-add -A will just arbitrarily add every single SSH key/identity you have to the agent even if it’s not necessary to do so such as in the case of Vagrant boxes.
#Password for sierra mac password
So the SSH agent tried all of my SSH keys, failed and I couldn’t even get to the password prompt. Long story short, I ended up being locked out of a remote server due to too many failed tries based on SSH keys/identities since the server access was based on a password and SSH keys/identities are SSH keys/identities. So while the ssh-add -A option should work for most basic cases, I ran into an issue recently where I had 6-7 Vagrant boxes (which uses SSH keys/identities for access) setup on a machine on top of the more common id_rsa.pub in place. Now when you open a new Terminal window, all should be good! Method 2: Add only SSH keys that are in the keychain to the agent. So if you want to never worry about this again, just open up your user’s ~/.bash_profile file like this: nano ~/.bash_profileĪnd add this line to the bottom: ssh-add -A 2>/dev/null Now this works but it won’t persist across reboots. So one solution I found is to run ssh-add with the -A option-which adds all known identities to the SSH agent using any passphrases stored in your keychain-like this: ssh-add -A Method 1: Add all known keys to the SSH agent. Here are two methods I know of to deal with this issue.
#Password for sierra mac code
I had this issue as well when attempting to deploy some code using Capistrano.
