All Products
Search
Document Center

Elastic Compute Service:Enter single-user mode on a Linux or FreeBSD system

Last Updated:Sep 22, 2025

If system or driver issues prevent you from connecting to your Elastic Compute Service (ECS) instance with tools like Workbench or Session Manager, you can boot into single-user mode. Also known as maintenance mode, this mode bypasses the standard boot process to provide a minimal environment with root permissions for emergency maintenance.

Procedure

Important

Single-user mode grants full control over the system. Incorrect operations can corrupt or damage system files. Before performing maintenance, create a snapshot of the system disk.

Alibaba Cloud Linux

Important

This procedure only applies to Alibaba Cloud Linux 3.

  1. Connect to an instance using VNC.

  2. Run the reboot command to restart the operating system.

    If you cannot log on to VNC, restart the instance from the console.
  3. During the restart process, press and hold the E key to edit the system boot parameters.image

  4. Locate the kernel boot line that starts with linux. Replace the content from ro to the end of the line with rw init=/bin/sh crashkernel=auto. This change grants read-write permissions and specifies /bin/sh as the initialization process.

    • Original content:

      linux (Sroot) /boot/umlinuz-5.10.134-19.1.a18.x86_64 root=UUID=********-****-**\
      **-****-************ ro rhgb quiet cgroup-memory=nokmem crashkernel=0M-2G:0M, \
      2G-8G: 192M, 8G-128G:256M, 128G-3766:384M,376G- :448M spec_rstack overflow-off uri\
      ng_force_dma_api kence-sample_interval=100 kfence.booting_max=0-2G:0,2G-32G :2\
      M.32G-:32M preempt=none biosdeuname=0 net. ifnames=0 console=tty0 console=ttySO\
      , 115200n8 noibrs nume_core.io_timeout=4294967295 nume_core.admin_timeout=42949\
      67295 cryptongr.notests rcupdate.rcu_cpu_stall_timeout=300
    • Modified content:

      linux (Sroot) /boot/umlinuz-5.10.134-19.1.a18.x86_64 root=UUID=********-****-**\
      **-****-************ rw init=/bin/sh crashkernel=auto
  5. Press Ctrl+x or F10. The system enters single-user mode.

CentOS/Debian/SLES/Anolis OS

This example uses a CentOS system.

  1. Connect to the instance using VNC.

  2. In the VNC window, log on and run the reboot command to restart the instance.

  3. During the restart process, press and hold the E key to edit the system boot parameters.image

  4. Locate the kernel boot line that starts with linux and add single to the end of the line.

    • Original content:

      linux16 /boot/vmlinuz-*.**.*-****.***.*.***.***_** root=UUID=********-\
      ****-****-****-************ ro crashkernel-auto spectre_v2=retpoline rhgb quie\
      t net. ifnames=0 console=tty0 console=ttySo, 115200n8 noibrs nume_core.io_timeous\
      t=4294967295 nume_core.admin_timeout=4294967295
    • Modified content:

      linux16 /boot/vmlinuz-*.**.*-****.***.*.***.***_** root=UUID=********-\
      ****-****-****-************ ro crashkernel-auto spectre_v2=retpoline rhgb quie\
      t net. ifnames=0 console=tty0 console=ttySo, 115200n8 noibrs nume_core.io_timeous\
      t=4294967295 nume_core.admin_timeout=4294967295 single
  5. Press Ctrl+X or F10. When prompted, enter the root password. The system then enters single-user mode.

Ubuntu

Important

This procedure only applies to Ubuntu 18.04.

  1. Connect to the instance using VNC.

  2. Run the reboot command to restart the operating system.

    If you cannot log on to VNC, restart the instance from the console.
  3. During the restart process, press and hold the Shift key to enter the GRand Unified Bootloader (GRUB) menu.image

  4. On the GRUB screen, select the second option, Advanced options for Ubuntu. On the next screen, select recovery mode. Then, press E to edit the boot entry.

  5. Find the kernel boot line that starts with linux. Replace the content from ro to the end of the line with rw single init=/bin/bash. This change grants read-write permissions and specifies /bin/bash as the initialization process.

    • Original content:

      linux /boot/vmlinuz-4.15.0-213-generic root=UUID=d406d971-bc6d-40f2-b\
      572-6+74ac689736 ro recovery nomodeset dis_ucode_ldr
      vga=792 console=tty@ console=ttySo, 115\
      200n8 net. ifnames=0 noibrs iommu=pt nvme_core.multipathen nvme_core.io_timeout=4294967295 nv\
      me_core.admin_timeout=4294967295
    • Modified content:

      linux /boot/vmlinuz-4.15.0-213-generic root=UUID=********-****-****-*\
      ***-*+********** rw single init=/bin/bash
  6. Press Ctrl+x or F10. The system enters single-user mode.

FreeBSD

  1. Connect to the instance using VNC.

  2. Run the reboot command to restart the operating system.

    If you cannot log on to VNC, restart the instance from the console.
  3. After the system reboots, the VNC console displays the Boot Menu. Press 5 to switch the Cons output mode to Video primary.

    image

  4. Press 2 to select Boot Single User and enter single-user mode.

Next steps

In single-user mode, you can check system logs, inspect service statuses, and test network connectivity to diagnose and fix issues. For example, if a driver conflict prevents the system from booting, you can uninstall the conflicting driver to restore normal operation.