Search code examples
gitsshcentoscygwin

SSH windows->Linux: key-based login steps have no effect. Still asks for password


I read the other posts on this issue but the solutions were not the solutions to my problem. I followed 5 simple steps that seemed to work fine but I'm still being asked for my password. It seems like the CentOS server is not even trying to use rsa keys.

On the Windows10 client (Cygwin) I ran:

ssh-keygen -t dsa
chmod 600 .ssh/id_dsa
scp .ssh/id_dsa.pub [email protected]:

On the CentOS server:

cat id_dsa.pub >> .ssh/authorized_keys
chmod 700 .ssh  

Finally, the last step should be to try to ssh into the server again and it shouldn't ask for the password. It does still ask for a password. I restarted the CentOS server and tried again but the problem persists. I closed and re-opened cygwin and the problem persists. I can see that my key was added to authorized_keys. The chmod commands worked. The ssh-keygen command worked. What am I missing?


Solution

  • Did you set proper permissions on authorized_keys?

    chmod 600 .ssh/authorized_keys