3

I switched from an El Capitan machine to a new MacBook Air with Sierra.
With El Capitan, when I ssh into an host from terminal, the SSH passphrase GUI dialog showed up, and then it never asked again the passphrase for the whole login session.

Now with Sierra the dialog is not showing up, I recurred to adding the following lines to .bashrc:

eval $(ssh-agent)
ssh-add

but the drawback is that every new terminal asks for the passphrase.

How to diagnose the missing dialog?

3

Instead of ssh-add, use

ssh-add -A

This uses the Keychain to find the passphrase, and since your Keychain should be unlocked because you're logged in, you won't be prompted.

(Sierra drastically changed how ssh keys are handled by the OS. The dialog is no more.)

  • thanks you for your answer, it says "No identity found in the keychain.". I suppose I need to make "Keychain Access" to know about the keys in my ~/.ssh, but how? – enzotib May 24 '17 at 17:33
  • 1
    @enzotib To add the passphrase to Keychain, run ssh-add -K and enter your passphrase. – grg May 24 '17 at 17:34
  • OK, I used ssh-add -K una tantum to add keys to my keychain, and I only leaved ssh-add -A in my .bashrc, and now it seems to work properly, thank you. – enzotib May 24 '17 at 17:57
  • @enzotib Yes, that's correct. If you change your ssh key, you'll need to re-run ssh-add -K once to add it to Keychain. – grg May 24 '17 at 17:57

You must log in to answer this question.

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