How to Disable SSH Root Login in Linux?
Last Updated :
17 Mar, 2021
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
openssh-client installation
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
openssh-server installation
Edit SSH access
Check the status of ssh server:
# sudo service ssh status
ssh status
Disable root ssh login:
# sudo gedit /etc/ssh/sshd_config
open config file command
The configuration file:
Permission is password protected
Change this “prohibited-password” to “no“:
Permit no
Now save the file and restart the ssh service using the below commands:
# service ssh restart
restart ssh service
Now you have successfully disabled the accessibility of root via ssh protocol.
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...