1.開機按ESC
2.選擇ubuntu 高級選項,按enter鍵進入,移動上下箭頭到第三個recovery mode
3.按e 進入編輯模式,刪除 recovery nomodeset,在之後添加 quiet splash rw init=/bin/sh
quiet:內核啓動時,簡化提示信息
splash:加載的時候啓動進度條提示,代替init的字符 提示過程
rw init=/bin/bash init進程設爲bash
4.ctrl+x啓動
5.passwd 修改root密碼或者 passwd + 用戶名,修改其他用戶的密碼
6.reboot -f 強制重啓,這樣你的root密碼就已經更改了