This is the dumbest thing because I have done this a load of times before and never had issue so I am sure I am just doing something daft but I can't for the life of me figure it out.
I am trying to connect from a Windows 7 machine to a Linux box using key based authentication.
Here are the steps I have followed;
- Ran
ssh-keygen -t rsa
from Git Bash. - Selected the default area for the file to be stored.
- Did not pick a password (left it blank)
- Copied the contents of id_rsa.pub onto the remote server (/home/user/.ssh/authorized_keys)
When I try and log in using ssh [email protected] -v
I can see that it tries to match up my keys from the correct location on the Windows box, but it does not accept them and ends up falling back to passwords as the authenitcation method.
I have checked the permissions of authorized_keys - it is set to rw for the owner only.
Any help would be greatly appreciated.
In addition to the permissions on authorized_keys, it is important to also set the permissions on the .ssh folder containing it:
As you can see, the permissions for
~/.ssh
should be 700, and the ones for~/.ssh/authorized_keys
should be 600.