How to deny/block root login in SSH
To block/deny root login in ssh, do the following (under FC4/5)
1.>vi /etc/ssh/sshd_config
2.Find the line:
#PermitRootLogin yes
Uncomment this line and change the word 'yes' to 'no' as follow:
PermitRootLogin no
3.Restart SSH: /etc/init.d/ssh restart
Finished!
Although user cannot login as root directly through SSH, they can login as normal user and 'sudo su -' to login as root. Please be careful.
1.>vi /etc/ssh/sshd_config
2.Find the line:
#PermitRootLogin yes
Uncomment this line and change the word 'yes' to 'no' as follow:
PermitRootLogin no
3.Restart SSH: /etc/init.d/ssh restart
Finished!
Although user cannot login as root directly through SSH, they can login as normal user and 'sudo su -' to login as root. Please be careful.
Comments