I've been through quite a few rounds of this over the years:
- Someone gives me their id_rsa.pub
- I copy it into
.ssh/authorized_keys
- I ask them to test
- Some time later, they test and report it doesn't work.
- I mess around with line feeds, permissions etc, go back to step 3.
Is there any way (obviously without asking for their private key) to verify that a public key has been installed correctly?
TROUBLESHOOTING
On your remote server, run the following:
You should see output similar to the following:
Note that the directory needs to include the file called
authorized_keys
with-rw-------
(600) permissions.Finally, run this command to check the permissions on your .ssh directory:
You should have a folder called
.ssh
withdrwx------
(700) permissions.If for either of these tests, you get blank output, or a message similar to the following:
Please repeat Steps 1 and 4-5 above.
Found this here