This topic describes how to boot an ECS instance that is created from a CentOS, Debian, SUSE Linux Enterprise Server (SLES), or Ubuntu image into single user mode.

Prerequisites

  • An Alibaba Cloud account is created. To create an Alibaba Cloud account, go to the account registration page.
  • An ECS instance is created. For more information, see Creation method overview. In this example, an ECS instance of the ecs.g6.large instance type is created.

Background information

Single user mode is one of the modes in which Linux distributions are booted. GRUB can be used to boot a Linux distribution into single user mode. After the system enters single user mode, you will have system administrator permissions and can modify all system configurations. This mode is usually used in the following scenarios:
  • Change the system password
  • Troubleshoot boot failures
  • Fix system exceptions
  • Maintain partitions of hard disk drives (HDD)
Notice In single user mode, you can modify critical system configurations. We recommend that you set this mode only when necessary and proceed with caution.

References

Example 1: How a CentOS ECS instance enters single user mode

In this example, an ECS instance running a CentOS 8.0 64-bit operating system is used.

  1. Connect to the ECS instance.
    For more information, see Overview.
  2. Run the reboot command to restart the ECS instance. When the interface for selecting a boot system appears, press the E key to go to the configuration interface for boot options.
    The following figure shows the configuration interface for boot options.os1
  3. Move the pointer to the line that starts with linux by using the arrow keys on the keyboard. Replace the content from ro to the end of the line with rw init=/bin/sh crashkernel=auto.
    The following figure shows the information after the change is made.os2
  4. Press the Ctrl+X composite key or the F10 key.
    The system enters single user mode. The following figure shows the interface for resetting the system password.os3

Example 2: How a Debian ECS instance enters single user mode

In this example, an ECS instance running a Debian 10.2 64-bit operating system is used.

  1. Connect to the ECS instance.
    For more information, see Overview.
  2. Run the reboot command to restart the ECS instance. When the configuration interface for kernel options appears, press the E key to go to the GRUB interface.
    The following figure shows the GRUB interface.db1
  3. Move the pointer to the line that starts with linux by using the arrow keys on the keyboard. Append single to the end of the line.
    The following figure shows the information after the change is made.db3
  4. Press the Ctrl+X composite key or the F10 key to start the system. Enter the password of the root user.
    The system enters single user mode.db4

Example 3: How a SLES instance enters single user mode

In this example, an ECS instance running a SLES 15 SP1 64-bit operating system is used.

  1. Connect to the ECS instance.
    For more information, see Overview.
  2. Run the reboot command to restart the ECS instance. When the configuration interface for kernel options appears, press the E key to go to the GRUB interface.
    The following figure shows the GRUB interface.sles1
  3. Move the pointer to the line that starts with linux by using the arrow keys on the keyboard. Append single to the end of the line.
    The following figure shows the information after the change is made.sles2
  4. Press the Ctrl+X composite key or the F10 key to start the system. Enter the password of the root user.
    The system enters single user mode.sles3

Example 4: How an Ubuntu ECS instance enters single user mode

In this example, an ECS instance running an Ubuntu 18.04 64-bit operating system is used.

  1. Connect to the ECS instance.
    For more information, see Overview.
  2. Run the reboot command to restart the ECS instance. During the restarting process, press the Shift key to go to the GRUB interface.
    The following figure shows the GRUB interface.ubt1
  3. Select the Advanced options for Ubuntu in the second line of the GRUB interface and press the Enter key.
  4. Select the recovery mode in the second line on the interface that appears and press the E key to edit the boot options.
    ubt2
  5. On the editing page, move the pointer to the line that starts with linux by using the arrow keys on the keyboard. Replace the content from ro to the end of the line with rw single inti=/bin/bash.
    The following figure shows the information after the change is made.ubt4
  6. Press the Ctrl+X composite key or the F10 key.
    The system enters single user mode. The following figure shows the interface for resetting the system password.ubt5