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.
Enter the init command.
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.
Edit and change the following.