按 Shift 没反应,说明你的机器大概率是 UEFI 启动,换 Esc 试一次,连续按两次,会看到界面,多按了可能会进到grub
进入 root shell
-
在 Advanced options for Ubuntu 里,选择带 recovery mode 的那一项,按回车。
-
进入恢复菜单后,用方向键选:
textroot Drop to root shell prompt按回车。
-
下面如果出现提示,按回车继续,直到看到类似:
textroot@ubuntu:~#
重置 w408 的密码
依次输入:
bash
mount -o remount,rw /
passwd w408
然后按提示输入两次新密码。输入时屏幕不会显示字符,正常。
成功后会提示类似:
text
passwd: password updated successfully
再执行:
bash
reboot
重启后用新密码登录 w408。
如果提示要输入 root 密码
说明恢复模式被保护了,这时退回 GRUB 菜单,选中正常 Ubuntu 启动项,按 e ,找到以 linux 开头的一行,把里面的:
text
ro quiet splash
改成:
text
rw init=/bin/bash
然后按 Ctrl+X 或 F10 启动,进入 root shell 后再执行:
bash
passwd w408
sync
reboot -f