I cannot get password-less logins working on my Mac OS X 10.9.5 Mavericks machine. I can login to a remote Ubuntu box after setting up the authorized_keys
file properly. However, I cannot do there reverse.
So I tried to troubleshoot the Mac setup by figuring out if I can do this without a password:
ssh localhost
Doing that on my Ubuntu box works well, but the Mac keeps asking for passwords. Yes I checked the authorized_keys
file as well as the known_hosts
file and made sure the id_rsa.pub
key was present in both of them for my Mac. But I cannot SSH to localhost
without a password.
I read the other posts such as this one.
And even enabled the following two settings(by deleting the hashtag in front of them) in the sshd_config
file:
RSAAuthentication yes
PubKeyAuthentication yes
Still getting asked for the password.
Put copies of the authorized_key
and known_hosts
files in the etc directory.
Still getting asked for the password.
Best Answer
I provided an answer on Stack Overflow that explains the step-by-step process needed to set up password-less access via SSH. Here are those instructions adapted for your specific needs.
First, set the SSH connection into verbose mode by using the
-v
flag like this:As explained in the
ssh
man page; accessible viaman ssh
:This has saved me a lot of headaches in the past by showing me exactly how the login process is flowing & what exactly is clogging it up. For example, here is the output of me running that command on my local Mac OS X 10.9.5 machine:
As you can see, it gets up the password prompt. But prior to that it is clearly checking for my RSA public key. And since I don’t have one, it just rolls over to the next authentication method. Pay attention to the output of
ssh -v
when you run it on your set to see where things get choked.Also be sure the SSH files on the destination machine have permissions that match the following & are owned by the account trying to access like this example shows:
So run this command to
chmod
theauthorized_keys
file:And run this command to
chmod
theid_rsa
file: