我在虚拟机 (VM) 中忘记了我的 ubuntu 18.04 根密码。要重置此密码,我在重新启动机器时按“esc+enter”,然后选择高级选项以获取以下菜单:
Ubuntu, with Linux 4.15.0-34-generic
Ubuntu, with Linuc 4.15.0-34-generic (recovery mode)
Ubuntu, with Linux 4.15.0-34-generic
Ubuntu, with Linuc 4.15.0-34-generic (recovery mode)
Ubuntu, with Linux 4.15.0-34-generic
Ubuntu, with Linuc 4.15.0-34-generic (recovery mode)
同一组项目在我的 VM 中出现了 3 次。我选择了恢复模式 --> “root Drop to root shell prompt”。然后,我得到:
Give root password for maintenance
(or press Control-D) to continue):
我尝试了 Ctrl+d 和 Crtl+shift+d (Ctrl+D),但它们都让我回到了包含以下内容的菜单:
root Drop to root shell prompt
然后,这个过程循环。有人知道问题出在哪里吗?
答案 0 :(得分:0)
您需要编辑您的 grub 引导加载程序并添加以下行:
rw init=/bin/bash
可在此处找到更多信息: