1. 程式人生 > >【Linux】root密碼忘記終極解決方法

【Linux】root密碼忘記終極解決方法

1、重啟Ubuntu,在最開始按ESC

2、進入Advanced options for Ubuntu,recovery mode,回車

3、選 root Drop to root shell prompt,回車

4、輸入如下命令

chmod 666 /dev/null 

mount -o remount,rw /

chmod 777 /etc/passwd

pwconv

passwd

重設密碼之後

reboot