Search
Close this search box.

How to Boot into Single User Mode in CentOS/RHEL 7 on VPSie

Table of Contents

What is Single User Mode?

 Single-user mode in Unix-like operating systems allows the system to boot with only one user logged in and all services except essential ones disabled. In this mode, the system boots up in a minimal environment, with only a few system processes running. This allows the system administrator to perform maintenance and troubleshooting tasks that require exclusive access to the system without interference from other users or services.

 

This tutorial will demonstrate How to Boot into Single User Mode in CentOS/RHEL 7.

 

Login to your VPSie account – Click on the VPS you would like to work on —> Access —> Console access —> Send ALT + CTL + DEL

Single user mode

 is a mode in which a multi-user computer operating system boots into a single superuser. It is mainly used to maintain multi-user environments such as network servers. Some tasks may require exclusive access to shared resources.

The first thing to do is to open Terminal and log in to your CentOS 7 server.

After restarting, your server, wait for the GRUB boot menu to show.

The next step is to select your Kernel version and press e essential to edit the first boot option. Find the kernel line (starts with “linux16“), then change the ro to rw init=/sysroot/bin/sh .

When you have finished, press Ctrl-X or F10 to boot into single-user mode

After mounting root filesystem using the following command:

chroot /sysroot/

Now, to complete this process reboot your server using the following command:

reboot -f

 

Compared to other systems 

Single, user mode is a standard feature in most Unix-like operating systems, including Linux, FreeBSD, and macOS. The process of booting into single-user mode is similar across these systems, although the specific steps may vary depending on the distribution or version.

Boot into Single-User Mode in CentOS Booting into the single-user mode in CentOS can be done using several methods, including modifying the GRUB boot loader configuration or using the system recovery disk.

Method 1: Modifying GRUB Boot Loader Configuration The GRUB boot loader is the default for most Linux distributions, including CentOS. To boot into single-user mode using this method, follow these steps:

  1. Reboot the system and wait for the GRUB menu to appear.
  2. Highlight the CentOS kernel you want to boot into and press the ‘e’ key to edit the boot parameters.
  3. To move forward, locate the line that starts with “linux16” or “linuxefi” and append the term “single” to the end of the line, with a space between the bar and the added word.
  4. Press Ctrl+x or F10 to boot into single-user mode.

Method 2: Using the System Recovery Disk If you cannot modify the GRUB boot loader configuration, you can use the system recovery disk to boot into single-user mode. Here are the steps:

  1. Insert the CentOS system recovery disk into the CD/DVD drive and boot the system.
  2. At the boot menu, select “Troubleshooting” and press Enter.
  3. Select “Rescue a CentOS system” and press Enter.
  4. Follow the on-screen instructions to mount the root file system and chroot into it.
  5. Once you have chrooted into the root file system, type “systemctl isolate rescue. target” to boot into single-user mode.

Use Cases of Single-User Mode

 Single-user mode is typically used for system maintenance and troubleshooting tasks requiring exclusive system access. Some everyday use cases include:

  1. Resetting the root password: If you have lost or forgotten it, you can boot into single-user mode to reset it.
  2. Repairing file systems: If the file system is corrupted or has errors, you can boot into single-user mode to improve it.
  3. Troubleshooting network issues: If the network is not working correctly, you can boot into single-user mode to diagnose and fix the problem.
  4. Upgrading the system: If you need to upgrade the system, you can boot into single-user mode to ensure that no other processes that could interfere with the upgrade are running.

Features of Single-User Mode

 The single-user mode boasts a range of essential functions for maintaining the system and resolving issues. These include:

  1. Exclusive access to the system: Single-user mode allows the system administrator exclusive access to the system without interference from other users or services.
  2. Minimal environment: Single-user mode boots up in a minimal environment with only a few system processes running, making it ideal for maintenance and troubleshooting tasks.
  3. No network services: In single-user mode, all network services are disabled, ensuring no traffic is sent or received.
  4. Complete control: In single-user mode, the system administrator has complete control over the system, allowing them to perform any maintenance or troubleshooting tasks necessary.

Advantages of Single User Mode

 Single-user mode offers several benefits, including:

  1. Exclusive access: Single-user mode allows the system administrator exclusive access to the system, ensuring that no other users or services interfere with maintenance or troubleshooting tasks.
  2. Security: Single-user mode is a secure environment that limits access to the system, reducing the risk of unauthorized access or attacks.
  3. Starting in single-user mode with minimal settings is a smart move to reduce the chances of encountering conflicts or errors while performing maintenance or troubleshooting tasks.

Disadvantages of Single User Mode 

Single-user mode also has some drawbacks, including:

  1. Limited functionality: Single-user mode only provides a limited set of system processes, making it unsuitable for tasks that require full system functionality.
  2. Inconvenience: Booting into single-user mode requires a reboot of the system, which can be inconvenient if the system is in use or critical.

Alternative Options to Single-User Mode

 While single-user mode is a powerful tool for system maintenance and troubleshooting, it is not always the best option. Some alternative options include:

  1. Remote access: If the system can be accessed remotely, the administrator can perform maintenance and troubleshooting tasks without booting into single-user mode.
  2. Live CD/USB: A live CD or USB can boot the system into a different environment, providing complete system functionality while allowing the administrator to perform maintenance and troubleshooting tasks.
  3. Virtual machine: A virtual machine can create a separate environment for testing or troubleshooting without affecting the production system.

Conclusion Booting into the single-user mode in CentOS is a simple process that provides exclusive access to the system and a minimal environment for maintenance and troubleshooting tasks. While it has some limitations, single-user mode is a powerful tool for system administrators. It can be used to reset passwords, repair file systems, troubleshoot network issues, and upgrade the system. However, alternative options such as remote access, live CD/USB, and virtual machines can also be helpful depending on the specific use case. Ultimately, the choice of which method to use will depend on the requirements of the task at hand and the available resources.

 

 

If you have questions, you can always ping us on chat or open a support ticket for help.

How to Install CMake on Ubuntu

Single User Mode is a mode in which the system boots with a minimum set of services, allowing you to troubleshoot and fix any issues with the system.

Follow these steps to boot into Single User Mode on VPSie:

  1. Start your VPSie and wait for the GRUB boot loader screen to appear.
  2. Use the arrow keys to highlight the kernel you want to boot and press the ‘e’ key to edit it.
  3. Move the cursor to the end of the line starting with “linux16” or “linuxefi” depending on your system, and add the word “single” (without the quotes) at the end of the line.
  4. Press Ctrl-X or F10 to boot the system with the modified kernel command line.

Once you’re in Single User Mode, you’ll be logged in as the root user and have access to a minimal set of services. You can use this mode to troubleshoot and fix any issues with the system. Some common tasks include:

  • Checking and repairing the file system
  • Resetting a forgotten root password
  • Updating system packages
  • Changing system configuration files
Make a Comment
Share on
Facebook
Twitter
LinkedIn
Print
VPSie Cloud service

Fast and Secure Cloud VPS Service

Try FREE
For a month

The First 1 orders gets free discount today! Try Sign up on VPSie to get a chance to get the discount.