Linux Single User Mode

Single user mode is the one of the Run level in the Linux operating system, Linux operating system has 6 run levels that are used for different requirement or situation. Single user mode mainly used for doing administrative task such as cleaning the file system, Managing the quotas, Recovering the file system and also recover the lost root password. In this mode services won’t start, none of the users are allowed to login except root and also system won’t ask for password to login.

Single user mode can be activated by command or inittab file or editing the argument while booting, first two mode requires root password because you have to login for entering the command or editing the inittab file whereas argument method does not required any password.

Command Method:

Command mode is the very simple method, just need to enter the following command by login as root. This is very useful when you are enabling the quotas for the user, because it will not restart the server; it only stops the services which are running at the current run level.Init is the command to change the run level where as 1 is the mode of run level.

Login as root.

su -l

Enter the init command.

init 1

Inittab File Method:

Inittab is the flat configuration file that handles the mode of system starting, can be found under /etc directory. While system boot’s kernel reads this file and starts the init process according to the entry made on that file. Inittab file entry ranges from 0 to 6 run levels, we requires only single user mode.

0 – Halt

1- Single user mode

2 – Single user mode with networking

3 – Multi user mode

4 – Reserved

5 – Graphical mode

6 – Reboot

So open up the inittab file.

vi /etc/inittab

Edit and change the following.

Once you made the changes on the file, reboot your machine. The machine will start with single user mode, do all the administrative task; remember to undo your changes to normal mode after finishes ( other wise machine will start always in single user mode).

Argument Method:

Start your machine, machine will display the counting; press any key to enter in to the menu.
The menu lists the number of operating system installed on the machine, in my case i have only one operating system installed on the machine. The list will look like below. Select your opertaing system by using arrows and press a to modify the kernel arguments.
At the end of kernel type single and then press enter.
Now you will get the hash prompt without asking root password.
The last method suitable for recovering the lost root password, this method is viewed as security vulnerability because it does not ask password. You can just issue the passwd command to reset the password.

Search Term:

Linux Single User Mode,
CentOS Single User Mode,
Redhat Single User Mode,
Single User mode in Linux,
Single User mode in CentOS,
Single User mode in Redhat,
Single user mode in Fedora,
Fedora Single User mode,
Setup Single User Mode,
Setup single use mode CentOS,
Setup single user mode redhat,


Share This Post