I'm trying to disable root login on VPS

I have setup a VPS in Linode and set it up to load with a SSH key which seems to work because I no longer need the password in order to log in but when I edit the PermitRootLogin, PasswordAuthentication, and UsePAM commands to “no” I am no longer able to log in to the VPS, I have tried 4 times with the same results. I am looking for advice if anyone has a suggestion on how to solve this problem I would appreciate the help. I am trying to prevent someone from using a password to access the VPS, and I am using Linux Mint installed on an iMac.
Thanks, Rich

No response yet? Just bumping this up.

I got this error when I tried to log in to the VPS as root:

sign_and_send_pubkey: signing failed for RSA “/home/e/.ssh/id_rsa” from agent: agent refused operation

I set up the key when I created the new VPS. Have you seen anything similar? I could log in with the password.

Hi @TNlass, Here is what I did to get my vps loading without using root. I set up a second user and then added the ssh key to that user following the directions on the cheat sheet after the video “015 Hardening the Security of your VPS” and then I was able to log in with the new user with out a password. I then went in and disabled the root user and password and it worked I couldn’t log in with root. I think when we follow directions to disable root and password it stops root or password log in and I wasn’t getting the ssh key put into the second user (i’m still not sure why) which locked me out of the vps. I hope you can understand this I’m not sure if I am being clear, if not let me know and I will try a to explain.

Thanks. I had already set up the second user. When I disabled the root and password logins, the key didn’t work on the second user. I can’t remember if I tried to log in with the key on the second user. I guess that is what I will confirm next before I try and disable anything.

Glad you got it working!