# macOS Sierra: Why do I have to enter the password for my private key? [duplicate]

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 '16 at 15:46
• Done! Thanks. Problem still exists. Yes, it is using my key. – GrokSrc Oct 10 '16 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 '16 at 15:48
• It didn't used to require a password. – GrokSrc Oct 10 '16 at 15:49
• – Ben Creasy Feb 18 '18 at 23:40

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

• 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 '16 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 '16 at 18:53
• Thanks @Vagner, ssh-add -A in my bash_profile fixed it. – GrokSrc Oct 10 '16 at 19:36

You can remove the passphrase

https://stackoverflow.com/a/112409/2774776

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

https://superuser.com/a/269570/365431

• 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 '16 at 17:02