Report this

What is the reason for this report?

root access problem after changing ssh_config to PermitRootLogin no

Posted on June 13, 2016

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

Thanks



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!

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.

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 :)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.