Why does Mountain Lion ask me for my password when trying to SSH even though I have setup public/private keys?
In Mountain Lion the sshd configuration (/etc/sshd_config) was changed and sshd no longer looks at ~/.ssh/authorized_keys2 for valid keys.

/etc/sshd_config on Lion (line 46):

#AuthorizedKeysFile     .ssh/authorized_keys


/etc/sshd_config on Mountain Lion (line 48):

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile      .ssh/authorized_keys


If you don’t wish to edit the /etc/sshd_config on the target machine you can either rename ~/.ssh/authorized_keys2 to ~/.ssh/authorized_keys or symlink it.

Symlink ~/.ssh/authorized_keys to ~/.ssh/authorized_keys2

ln -s ~/.ssh/authorized_keys ~/.ssh/authorized_keys2


Rename ~/.ssh/authorized_keys2

mv ~/.ssh/authorized_keys2 ~/.ssh/authorized_keys