I have recently setup a key based SSH on my server on Centos 7.4, it worked for few days and today out of sudden it said server refuses our key. But root can still login using the key for root, any one has any idea?

The key was generated from puttygen and copied /home/user/.ssh/authorized_keys, I haven't changed anything since then.

  • after I set use PAM to yes, it works so far – ronnie Jan 30 '18 at 7:17

My experience with errors like this is typically - the computer is right.

I this situations this means:

  • the server does not know about the key you are using
    • you changed the private ssh key to authenticate yourself
    • and/or you removed the public ssh key from the authorized_keys on the server

there are more options, but for a start it would be good to check this

maybe you have executed ssh-keygen on your local machine on you overwrote your .ssh/id_rsa* keypair?

please check that the matching public-key for the private-key you are using is in the .ssh/authorized_keys in the users' userhome on the server you want to access.

please check and/or provide some verbose/log output - for eg. ssh -v ... from the client

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.