Saturday, August 4, 2012

Password-Free SSH on OS X Mountain Lion

I had set up my home network with password-free ssh access between various Mac computers. But when I recently upgraded to OS X Mountain Lion, this stopped working.

Turns out /etc/sshd_config is modified during Mountain Lion installation. The following line gets unchecked:

# 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

Once I had renamed ~/.ssh/authorized_keys2 to ~/.ssh/authorized_keys on my Mountain Lion computers, everything worked fine again.