Linux 或者 centos 启用Boot 单用户模式来重置修改密码,修复启动问题,single教程
原文介绍
Boot Into Single User Mode (Reset Root Password)
To reset the root password of your server, you will need to boot into single user mode.
Access the Manage section of your server in the customer portal and follow these steps. The option depends on the bootloader version on the machine:
Option 1 (CentOS 6 Linux, etc)
Click to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click to restart the server.
You will see a GRUB boot prompt telling you to press any key - you have only a few seconds to press a key to stop the automated booting process. (If you miss this prompt you will need to restart the VM again)
At the GRUB prompt, type "a" to append to the boot command
Add the text "single" and press enter
System will boot and you will see the root prompt. Type "passwd" to change the root password and then reboot again.
Option 2 (Debian, Ubuntu, CentOS 7, etc)
Click to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click to restart the server.
You will see a GRUB boot prompt - press e to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
Find the kernel line (starts with "linux /boot/") and add init="/bin/bash" at the end of the line
Press CTRL-X or F10 to boot
System will boot and you will see the root prompt. Type "mount -rw -o remount /" and then "passwd" to change the root password and then reboot again.
FreeBSD
The boot menu has an option to boot into single user mode. Press the key for single user mode (2). At the root prompt, type "passwd" to change the root password and then reboot again.
下面是CENTOS方法
进去如图所示,选择第二项,按下a,然后空格,加入single回车即可。然后进入系统,无需加载一切网络模块mod等,可以直接进入ssh,修改密码,修复开机启动故障,等等操作
页:
[1]