How to Disable Root SSH Access in Linux

Leaving root access enabled by default opens you up to additional security issues and it’s much more recommended to instead disable root access and use sudo within another SSH account to authenticate root level commands.

  • Step 1. Log in to your server via a terminal client.

  • Step 2. Edit the "/etc/ssh/sshd_config" file using a text editor.
sudo nano /etc/ssh/sshd_config/
  • Step 3. Scroll down or search to find "#PermitRootLogin no"

  • Step 4. Remove the "#" and then exit and save the file.

  • Step 5. Restart the SSHD service with the following command.
sudo service sshd restart
Please rate this article to help us improve our Knowledge Base.

0 0