root access problem after changing ssh_config to PermitRootLogin no

Hi people

I hope someone can help me

I created a sudo user after that i made keys for that user all workes fine with that user then i set in ssh_config to PermitRootLogin no and i think i did that when i loged in a root… i have the feeling i locked myself out from the server

now the problem is i cant login as root anymore…but i need that to change some stuff around.

Be careful im a Newbie to all this :-)

Anyway I hope some points me in a right direction


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.

Log in as your new user?

A few tips when creating a new user on a fresh droplet. Do these commands when logged in as root: useradd -m -G sudo newuser (the group sudo depends on your distribution) passwd root passwd newuser chsh -s /bin/bash (changes the log in console)* mkdir /home/newuser/.ssh && cp /root/.ssh/authorized_keys /home/newuser/.ssh/ (this is if you used the ssh key to create the droplet)*

Now just remove login as root, relog and the new user and you should be fine :)