For security reason, we need to configure linux operating system in order there is no intruder can access our system as root. one way is to disable login for root either in local or remotely. In this post we will discuss about it :
Disable root login locally
Below are the steps to do In order root can't login directly :
Disable root login Remotely
This method will disable root logins from remote connections using ssh. Below are the steps to do that :
Disable root login locally
Below are the steps to do In order root can't login directly :
- Login as root
#su -
- backup /etc/securetty
# mv /etc/securetty /etc/securetty.bak
- create new file empty /etc/securetty
# echo > /etc/securetty
- restart system
# init 0
Disable root login Remotely
This method will disable root logins from remote connections using ssh. Below are the steps to do that :
- edit file /etc/ssh/sshd_config
# vim /etc/ssh/sshd_config
- change option "PermitRootLogin yes" become "PermitRootLogin no"
- restart sshd service
# service sshd stop # service sshd start
No comments:
Post a Comment