1.23 VMware 11中Ubuntu 64-bits 14.04的root密码忘了 https://scz.617.cn/unix/201501071621.txt A: 下面这个办法不能解决问题,记录备忘: -------------------------------------------------------------------------- 1) 重启Ubuntu,长按Shift进入GRUB菜单 2) 选中"*Advanced options for Ubuntu",回车 3) 选中"*Ubuntu, with Linux 3.13.0-24-generic (recovery mode)",回车 4) 进入Recovery Menu,选中"Drop to root shell prompt",回车后提示: Give root password for maintenance 没有root密码无法继续 -------------------------------------------------------------------------- 正确办法: -------------------------------------------------------------------------- 1) 重启Ubuntu,长按Shift进入GRUB菜单 2) 选中"*Advanced options for Ubuntu",回车 3) 选中"*Ubuntu, with Linux 3.13.0-24-generic (recovery mode)",不要回车,直 接按e键 4) 向下找到这一行(一般是倒数第三行): linux /boot/vmlinuz-3.13.0-24-generic root=UUID=... ro recovery nomodeset 将之修改成: linux /boot/vmlinuz-3.13.0-24-generic root=UUID=... rw quiet init=/bin/sh 5) 按F10或Ctrl-X 6) 如果一切正常,会直接得到一个"root shell",可以重置任意用户密码。 以root身份重置任意用户密码时不受密码策略的限制,可以设置简单密码。 7) 此时无法shutdown,只能sync之后关电源 8) 第4步中的修改是临时的,不会写入文件系统,登录进入系统后可以这样确认: cat /boot/grub/grub.cfg | grep /boot/vmlinuz 也可以重新到第4步去确认。 --------------------------------------------------------------------------