How to Disable Root Access on VPS?

Root access to a server is a powerful tool that allows complete control over your virtual server. However, for security purposes, it is sometimes necessary to disable root access. In this article, we will explain in detail how you can disable root access on a VPS.

First, you need to log in to your VPS via SSH with your administrative credentials. After a successful login, follow these steps:

  • sudo nano /etc/ssh/sshd_config — This command will open the SSH server configuration file for editing.
  • PermitRootLogin no — Find the line PermitRootLogin in the opened file and change the value to no.
  • sudo systemctl restart sshd — In order for the changes to take effect, you should restart the ssh server.

After completing these steps, root access on your VPS will be successfully disabled. Remember that you can re-enable root access at any time by changing the value of PermitRootLogin to yes. Be careful and responsible when managing access to your server.

We hope this article was helpful for you. Follow the security rules and keep the data on your VPS safe.