Pages

Sunday, December 18, 2011

How to disable root login in linux

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 :
  1. Login as root
    #su -
  2. backup /etc/securetty
    # mv /etc/securetty /etc/securetty.bak
  3. create new file empty /etc/securetty
    # echo > /etc/securetty
  4. restart system
    # init 0
Now, root can't login from computer locally
Disable root login Remotely
This method will disable root logins from remote connections using ssh. Below are the steps to do that :
  1. edit file /etc/ssh/sshd_config
    # vim /etc/ssh/sshd_config
  2. change option "PermitRootLogin yes" become "PermitRootLogin no"
  3. restart sshd service
    # service sshd stop
    # service sshd start

No comments:

Post a Comment

Don't Forget To Join Our Community
×
Widget