By umpire
I’ve set up a new server using the Wordpress Ubuntu 20.04 image.
Previously with my servers I have always disabled root login for security reasons.
To do this it seems like you need to go to /etc/ssh/sshd_config and change “PermitRootLogin” from “prohibit-password” to “no”. But this line does not exist, and adding it does not stop me logging in as root, after running systemctl restart sshd.
I use SSH and don’t log into root with a password. Is it still recommended to set up another sudo user and disable root? If so, how do I do this?
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!
Hello,
It sounds like that you might have been editing the /etc/ssh/ssh_config file rather than the sshd_config.
I’ve just checked on a new server and I can confirm that the PermitRootLogin option is present.
On your second question, yes having a sudo user is still recommended rather than using root directly.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.