- 论坛徽章:
- 0
|
想不起Linux虚拟机密码...只能进入单用户模式下重设root密码.
linux 运行级别:
init 0 (停机)
init 1 (单用户模式)
init 2 (多用户模式,不能使用NFS)
init 3 (完全多用户模式,字符界面)
init 4 (未使用)
init 5 (图形界面的多用户模式)
init 6 (重启模式)
# runlevel (查看当前运行级别)
# init n (改变运行级别)
# vi /etc/inittab (改变系统默认启动进入的级别)
[color="#ff0000"] id:3:initdefault
在RedHat系统启动时,按向上或向下箭头进入GRUB编辑界面,按[color="#ff0000"]"e"做如下(红字)修改:
"e" to edit the commands before booting.
[color="#ff0000"] 修改:
kernel /boot/vmlinux-2.6.18-8.e15 ro root=LABEL=/ rhgb quiet
为:
kernel /boot/vmlinux-2.6.18-8.e15 ro root=LABEL=/ rhgb quiet 1
[color="#ff0000"] 然后按"b"键 运行系统
[color="#ff0000"]或者在RedHat系统启动时,按向上或向下箭头进入GRUB编辑界面,按[color="#ff0000"]"a"[color="#000000"]做如下(红字)修改:
"a" to modify the kernel arguments
[color="#ff0000"] 修改:
grub append> ro root=LABEL=/ rhgb quiet
为:
grub append> ro root=LABEL=/ rhgb single quiet
[color="#ff0000"]
确认后进入单用户模式下.修改ROOT密码.
重启系统后就能以新root密码进入正常模式.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93926/showart_1875154.html |
|