How to Disable SSH Root Login in Linux?
SSH or secure shell is a network protocol established between two computers on a network to communicate with each other and share data. This protocol is useful in the case of remote access to the machine. SSH makes the work easy and accessible anywhere. Here we will see how to disable SSH Root Login in Linux.
Installation of Openssh-server and Openssh-client
The client version is installed on the system if the requirements are only to connect to any available server over the network.
#sudo apt install openssh-client
The server version is installed on the system if the requirement is to make the system available to different ssh clients all over the network.
#sudo apt install openssh-server
Edit SSH access
Check the status of ssh server:
# sudo service ssh status
Disable root ssh login:
# sudo gedit /etc/ssh/sshd_config
The configuration file:
Change this “prohibited-password” to “no“:
Now save the file and restart the ssh service using the below commands:
# service ssh restart
Now you have successfully disabled the accessibility of root via ssh protocol.