How to boot into single user mode in CentOS/RHEL 7

The Linux Single User Mode, also known as Maintenance Mode, is a Linux Operating Systems where multiple main services are stared at boot time with basic funcionality allowing the administrator to perform certain important tasks.
A few of the most known tasks one can accomplish in single user mode are:
-Regaining access to a system when the root password has been lost.
-Run fsck on damaged partitions.
-..... of course the list can go on.

We're going to describe in this tutorial how to boot into single user mode on CentOS 7, keepin in mind that this will allow you to enter an emergency mode and access an recovery shell.



Booting into single user mode:

1. Let's restart the CentOS 7 machine, once the boot process has initiated and the grub window appears, make sure to hit say spacebar to stop the boot process:

CentOS 7 Grub Menu

2. Then let's select the kernel version we want to boot into and press "e" on the keyboard to edit the boot option. Then use the down arrow key to find the kernel line starting with "linux16" and change the argument ro to rw init=/sysroot/bin/sh as shown below":

edit centos 7 grub options


3. Once the previous step has been completed you can now press Ctrl-X or F10 to boot into single user mode (or maintenance mode)

centos 7 emergency shell

4. You can now mount root (/) filesystem with the following command:

    # chroot /sysroot/

You can now perform the required low-level tasks, and once done you can simply reboot to get back to the regular linux shell:
   
   # reboot -f


If you need a server to practice this tutorial on you should checkout our KVM server plans here: https://owned-networks.net/kvm.html


  • single user mode, linux single user, centos single user, maintenance mode linux, rhel single user
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

ownCloud Auto Install Script on Debian 7

Here is an easy way to install ownCloud on Debian 7 with a script, but first, for those who...

NGINX – Allow access only to certain IPs

Nginx has a nice module that not many people know about, it basically enables us...

How to configure NTP client in CentOS

What's NTP? NTP stands for Network Time Protocol, and it is an Internet protocol used to...

Initial Server Setup on CentOS 6

Here are some recommendations to setup your VPS or server when you first get it, some of these...

How To Install nginx on CentOS

What is NGINX? Nginx (pronounced "engine-x") is an open source reverse proxy server for HTTP,...