Help Center/ Elastic Cloud Server/ FAQs/ OS/ How Can I Boot a Linux ECS into Single-User Mode?
Updated on 2025-09-30 GMT+08:00

How Can I Boot a Linux ECS into Single-User Mode?

Scenarios

Single-user mode is a special system running mode of the Linux OS. In this mode, not all services may be loaded during startup, and a minimal runtime environment is provided. It is usually used for system maintenance and repair, and password resetting.

In single-user mode, you have high permissions. Incorrect operations may cause data loss or system damage. Exercise caution when performing operations in single-user mode.

This section describes how to boot a Linux ECS into single-user mode.

Procedure

  1. Remotely log in to the ECS.

    For details, see Logging In to a Linux ECS Using VNC.

  1. In the upper left corner of the login page, click Ctrl+Alt+Del to restart the ECS.

    This method does not apply to the following scenarios:

    • The ECS is experiencing lag.
    • The ECS is running EulerOS or Huawei Cloud EulerOS.
  2. Enter single-user mode from kernel edit mode.

    Select the instructions for entering single-user mode based on the OS type.

CentOS 7/8, CentOS Stream 8/9, AlmaLinux 8/9, and Rocky Linux 8/9

  1. After the ECS is restarted, the kernel page is displayed. Press e to enter kernel edit mode.
    Figure 1 Kernel page
  2. After entering kernel edit mode, use the arrow keys on the keyboard to move the cursor to the line starting with linux.
    Figure 2 Kernel editing mode
  3. Set the mode.
    • (Default) Single-user mode: In the line starting with linux, replace the content from ro to the end with rw rd.break.
    • Pre-mount mode: Replace the content from ro to the end with rw rd.break=pre-mount.

      The pre-mount mode is used to restore the file system of a system disk. Select the mode as needed.

    Figure 3 Single-user mode
    Figure 4 Pre-mount mode
  1. Press Ctrl and X to start the system. The system enters single-user mode.
    Figure 5 Starting the system
  2. Run the following command to switch to the real root directory:

    chroot /sysroot

    Figure 6 Switching to the real root directory

Ubuntu 20-24, Debian10-12, and openEuler

  1. After the ECS is restarted, the kernel page is displayed. Press e to enter kernel edit mode.
    Figure 7 Kernel page
  2. After entering kernel edit mode, use the arrow keys on the keyboard to move the cursor to the line starting with linux.
    Figure 8 Kernel editing mode
  3. Set the mode.
    • (Default) Single-user mode: In the line starting with linux, replace the content from ro to the end with rw init=/bin/bash.
    • Pre-mount mode: Replace the content from tty0 to the end with break.

      The pre-mount mode is used to restore the file system of a system disk. Select the mode as needed.

    Figure 9 Single-user mode
    Figure 10 Pre-mount mode
  4. Press Ctrl and X to start the system. The system enters single-user mode.
    Figure 11 Starting the system

openSUSE

  1. After the ECS is restarted, the kernel page is displayed. Press e to enter kernel edit mode.
    Figure 12 Kernel page
  2. After entering kernel edit mode, use the arrow keys to move the cursor to the line starting with linux.
    Figure 13 Kernel editing mode
  3. In the line starting with linux, replace the content from net to the end with rw init=/bin/bash.
    Figure 14 Single-user mode
  4. Press Ctrl and X to start the system. The system enters single-user mode.
    Figure 15 Starting the system