I recently upgraded my computer to macOS Sierra. Everything went fine, but somewhere along the way something got changed (probably something I did) and now every time I try to ssh into another machine the terminal prompts me to enter my password. If I type the password and enter it the ssh session works as normal. But why do I have to enter my password at all? What can I do to fix this?

Side note: I have tried changing the file permissions to no avail. They are currently 644 like the public key.

  • private key should be chmod 400 add a -v and see if it's using your key
    – Jacob Evans
    Oct 10, 2016 at 15:46
  • Done! Thanks. Problem still exists. Yes, it is using my key.
    – groksrc
    Oct 10, 2016 at 15:48
  • private keys are... private. that's why you need the password. it wouldn't be private if it did not require a password. sure you can make a private key without a password... but that's obviously less secure.
    – ETL
    Oct 10, 2016 at 15:48
  • It didn't used to require a password.
    – groksrc
    Oct 10, 2016 at 15:49
  • Also see apple.stackexchange.com/questions/48502/…
    – Ben Creasy
    Feb 18, 2018 at 23:40

2 Answers 2


You need add your private key to ssh agent again. I faced same problem after Sierra update.

Here is a guide to add your key.

  • This sort of worked. I added the key successfully using the ssh-add command but if I restart the terminal I am forced to do it again. I also tried the -K option for the command to add it to the keychain but after a reboot I still have to enter the password.
    – groksrc
    Oct 10, 2016 at 16:32
  • Make sure that you have only one agent running, in my case, I need enter pw for each reboot, if you want 'the old behavior', follow this question
    – Vagner
    Oct 10, 2016 at 18:53
  • 1
    Thanks @Vagner, ssh-add -A in my bash_profile fixed it.
    – groksrc
    Oct 10, 2016 at 19:36

You can remove the passphrase


or import the key into the key with passphrase into your Mac user’s keychain:


  • Welcome to Ask Different. While the links you provided may answer the question, it's advisable to summarize and/or provide the relevant details that answer the question here. Links often go stale making the answer useless.
    – Allan
    Oct 10, 2016 at 17:02

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