虚拟机ubuntu忘记root密码解决方案

虚拟机ubuntu忘记root密码解决方案:

     1、启动系统,长按【shift】进入GRUB界面,选择recovery mode,但不能按回车;

     2、按【e】,进入编辑界面;

     3、找到【linux /boot/vmlin......ro recovery nomoedset】所在行,将【ro recovery nomodest】替换为【quiet splash rw init=/bin/bash】,按下【ctrl + x】重启系统。

     虚拟机ubuntu忘记登陆用户密码:

     1、需知道root密码,具体参见上述过程找回;

     2、启动系统,长按【shift】进入GRUB界面,选择recovery mode,按回车进入;

     3、在界面上选择【root     Drop to root shell promopt】,回车进入;

     4、输入root密码,进入终端,使用命令【passwd username】更改用户的密码;

     5、若出现错误【authentication token manipulation error】表示所属文件为只读,使用命令【mount -rw -o remount /】即可。

猜你喜欢

转载自blog.csdn.net/kakaluote81/article/details/54893518