想不起Linux虚拟机密码,只能进入单用户模式下重设root密码.
linux 运行级别:
init 0 (停机)
init 1 (单用户模式)
init 2 (多用户模式,不能使用NFS)
init 3 (完全多用户模式,字符界面)
init 4 (未使用)
init 5 (图形界面的多用户模式)
init 6 (重启模式)
# runlevel (查看当前运行级别)
# init n (改变运行级别)
# vi /etc/inittab (改变系统默认启动进入的级别)
id:3:initdefault
在RedHat系统启动时,按向上或向下箭头进入GRUB编辑界面,按"e"做如下修改:
"e" to edit the commands before booting.
修改:
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
然后按"b"键 运行系统
或者在RedHat系统启动时,按向上或向下箭头进入GRUB编辑界面,按"a"做如下修改:
"a" to modify the kernel arguments
修改:
grub append> ro root=LABEL=/ rhgb quiet
为:
grub append> ro root=LABEL=/ rhgb single quiet
确认后进入单用户模式下,修改ROOT密码,重启系统后就能以新root密码进入正常模式。

