Root SSH Login Not Working

  • Posted on January 5, 2015
  • georgeAsked by george

I have a Ubuntu 14.04 system up and running. I created ssh keys on my Windows Desktop using Putty and pasted the public key into the authorized_keys file for my user account.

I am able to log into the user account using Putty and NotePad++ using the keys created on my Windows desktop. (Side note for others accessing using NotePad++, you have to convert your ssh key into Open SSH format in order for NotePad++ to work).

I added the same key into the /root/.ssh/authorized_keys file and then tried to access the server using the root account but I am getting an unauthorized access error message. It then asks for the root password but it doesn’t accept that password.

If I use the DO Web console interface I am able to login as root with the password I am using so I’m a bit confused what I’ve done wrong.

I’ve read a lot of the posts and tutorials so perhaps I’ve modified a file incorrectly along the way. Ultimately I want to allow only ssh key access but before I do that I need to at least get it working with the root account.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

There are 2 things that I did just now which allowed me to access the DO server using the root account with ssh keys.

  1. I have NO idea how but I noticed the actual /root directory had ownership by 5245:5245 instead of root:root. I checked all users and groups on the DO server and could not find a user or group with the 5245 name. I changed the /root directory to root:root (and recursively just to be sure).
  2. Just to be sure I also copied the /home/george/.ssh/authorized_keys file to /root/.ssh/authorized_keys
  3. Just to be sure again, I rebooted the DO machine.

Once I did that I was able to ssh in to the DO machine using the Ubuntu1, Ubuntu2, and Windows PC.

At least I won’t be laying in bed tonight trying to figure out what was going on but I still wonder why things were wrong!

What’s odd is that /var/log/auth.log is empty