忘記普通用戶密碼:
- 重啟Ubuntu,隨即長按shift進入recover mode菜單(或F10);
- 選擇recovery mode,回車確認;
- 在Recovery Menu中,選擇“Root Drop to root shell prompt”,回車確認;
- 進入shell界面,使用passwd命令重新設定密碼:passwd wangyu,回車確認;看到密碼設定成功提示:passwd: password updated successfully;重啟系統:sudo reboot;
如果出現Authentication token manipulation error錯誤原因是The problem was that the system was started as read only, 運行"mount -rw -o remount /"
忘記root密碼:
- 開機按F10進入grub時,按e(不是回車)
- 看到一行linux /boot/vm.......ro *****,(類似)
- 刪除*****, 在這行的最后添加 quiet splash rw init=/bin/bash
- 按F10, 啟動
- passwd, 系統會提示你輸入新的密碼,結束。