Mac OS X SSH Client asking for password after upgrade to Sierra 10.12.2

After installing of OS X (MacOS) Sierra update 10.12.2 I noticed that SSH connections started to ask for the password of my RSA key. This wasn’t how it worked before and not what I want (as I trust my MacBook Pro) as it is quite annoying.

For the current session the solution was quite simple, just run the command: ssh-add -A

There seem to be many discussions online in what is causing this (i.e. here) with strange theories and odd (or not working) solutions. As documented also here, the root cause seems to be that the upstream OpenSSH code has changed and that Apple’s developers are following the changes.

The solution is fortunately quite simple: just create a file called ~/Library/LaunchAgents/org.openssh.plist with the following content:

<plist version="1.0">
    <string>Add SSH Keys to SSH Agent</string>

And from the next login onwards your SSH key will be added to ssh-agent again.