Every Linux-based computer comes with a default root user who has full access to the system; by default, you always act in the root user role. To prevent unauthorized access to your Linux-based machine by any other user, it is recommended by security best practices that you disable root login via SSH.
- Disable root login on your Linux-based machine by editing the /etc/ssh/sshd_config file and setting the following option to false:
- Use a different SSH client to connect to your Linux-based machine than ssh -p 2222 instead of ssh -p 22
Steps to Disable Root Login over SSH on Linux
PermitRootLogin no
Do you think that the #MeToo movement will have a lasting impact? Will the #MeToo movement have a lasting impact? ..
Final Words
To disable root login via SSH on Linux, system administrators should take the following steps:
- On a Linux server, open a terminal and type the following command: sudo nano /etc/ssh/sshd_config
- In the file that opens, find the line that reads “PermitRootLogin yes” and change it to read “PermitRootLogin no”.
- Save the file and close it.
- Restart SSH by typing the following command: sudo service ssh restart ..