1 进入启动菜单
开机时,按Esc键,进入Grub引导页面。
2 编辑启动参数
光标移动到“Advanced options for Ubuntu”,按“e”进入编辑。
3 修改权限
将 “ro recovery nomodeset”改为 “rw single init=/bin/bash”。
4 进入单用户模式
按下“F10”或者“ctrl+x”,然后选择Recovery Menu中,选择“Root Drop to root shell prompt”,回车确认。
5 修改文件
比如修改sudoers文件,添加sudo命令用户,执行visudo命令,修改完成后按“F2”即可保存退出(F1显示帮助)。