If you cannot remotely connect to an ECS instance using Workbench, Session Manager, or a third-party client due to system configuration errors or driver issues, you can boot into single-user mode, also known as maintenance mode. This mode interrupts the normal boot process and provides a minimal system environment with root privileges for emergency maintenance.
Procedure
Single-user mode grants full control over the system. Incorrect operations can corrupt system files. Before you perform maintenance, we recommend that you manually create a snapshot of the system disk.
Alibaba Cloud Linux
This procedure applies only to Alibaba Cloud Linux 3.
-
Run the
rebootcommand to restart the operating system.If you cannot log on to the instance using VNC, restart the instance from the console.
-
During the restart, press and hold the
Ekey to edit the boot parameters. -
Locate the kernel boot line that starts with
linux. Replace the content fromroto the end of the line withrw init=/bin/sh crashkernel=auto. This enables read-write permissions and specifies the init 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
-
-
Press
Ctrl+xorF10to boot into single-user mode.
CentOS, Debian, SLES, and Anolis OS
This example uses a CentOS system.
-
In the VNC window, log on and run the
rebootcommand to restart the instance. -
During the restart, press and hold the
Ekey to edit the boot parameters.
-
Locate the kernel boot line that starts with
linux16and appendsingleto 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
-
-
Press
Ctrl+xorF10. When prompted, enter the root password to boot the system into single-user mode.
Ubuntu
This procedure applies only to Ubuntu 18.04.
-
Run the
rebootcommand to restart the operating system.If you cannot log on to the instance using VNC, restart the instance from the console.
-
During the restart, press and hold the
Shiftkey to enter the GRUB menu. -
In the GRUB menu, select
Advanced options for Ubuntu. On the next screen, select therecovery modeentry, then pressEto edit the boot entry. -
Locate the kernel boot line that starts with
linux. Replace the content fromroto the end of the line withrw single init=/bin/bash. This grants read-write permissions and starts a /bin/bash shell for single-user mode.-
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
-
-
Press
Ctrl+xorF10to boot into single-user mode.
FreeBSD
-
Run the
rebootcommand to restart the operating system.If you cannot log on to the instance using VNC, restart the instance from the console.
-
After the system restarts, the VNC terminal shows the
Boot Menu. Press5to switch theConsoutput mode toVideo primary.______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | |_| |_| \___|\___||____/|_____/|_____/ Welcome to FreeBSD 1. Boot Multi user [Enter] 2. Boot Single user 3. Escape to loader prompt 4. Reboot 5. Cons: Dual (Video primary) Options: 6. Kernel: default/kernel (1 of 1) 7. Boot Options -
Press
2to selectBoot Single Userto enter single-user mode.
Next steps
In single-user mode, you can check system logs, inspect service status, and test network connectivity to diagnose and resolve issues. For example, if a driver conflict prevents the system from booting, you can uninstall the conflicting driver to restore normal operation.