Steps to protect Single User Mode in RHEL

Login to the Linux as root user.

Open the /etc/inittab file in edit mode.

Append the following text to the file before the line containing ‘initdefault’.


Save and exit the file.

Following is the updated /etc/inittab file. Changes made to the file are highlighted.

# cat /etc/inittab 
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
# Author:       Miquel van Smoorenburg, 
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)



# System initialization.

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3

And more

Reboot the Linux machine.

# shutdown -r now

Use the initial steps in the article HOW TO RECOVER SDELEMENTS PASSWORD IN RHEL(REDHAT) to go to single user mode.

You need to enter the root password to get into the single user mode.

Your single user mode is password protected now.


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request