Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  30] [ 0]  / answers: 1 / hits: 44581  / 1 Year ago, sun, march 12, 2023, 10:29:22

My machine recently stopped accepting incoming public key authentication. I have an ubuntu 11.04 desktop that I ssh into from a windows machine. I use putty with pageant. I am able to connect but only with interactive password authentication, not with my rsa key that I have setup.



I have already verified that the key is listed in ~/.ssh/authorized_keys. How do I fix this and what do I check?


More From » ssh

 Answers
6

If public key authentication doesn't work: make sure that on the server side, your home directory (~), the ~/.ssh directory, and the ~/.ssh/authorized_keys file, are all writable only by their owner. In particular, none of them must be writable by the group (even if the user is alone in the group). chmod 755 or chmod 700 is ok, chmod 770 is not.



What to check when something is wrong:




  • Run ssh -vvv to see a lot of debugging output. If you post a question asking why you can't connect with ssh, include this output (you may want to anonymize host and user names).

  • If you can, check the server logs in /var/log/auth.log.

  • If public key authentication isn't working, check the permissions again, especially the group bit (see above).


[#42764] Monday, March 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cupwire

Total Points: 365
Total Questions: 126
Total Answers: 125

Location: Malaysia
Member since Thu, Feb 16, 2023
1 Year ago
cupwire questions
;