Skip to content

Instantly share code, notes, and snippets.

@chappyhome
Created August 28, 2016 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chappyhome/8ecaf3f073950029d16d60ed7bdb74f7 to your computer and use it in GitHub Desktop.
Save chappyhome/8ecaf3f073950029d16d60ed7bdb74f7 to your computer and use it in GitHub Desktop.
树莓 忘记密码
拔出記憶卡,放到其他台電腦裡,修改第一個分割區裡的cmdline.txt,裡頭只有一行,原本內容大概如下:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
在最後面加上「init=/bin/sh」。
然後放回Raspberry Pi開機,應該很快就會出現「#」提示字元,然後輸入底下的指令:
# su (變成超級使用者)
# passwd pi (重新設定帳號pi的密碼)
# sync (清空緩衝區,確保設定儲存生效)
# exec /sbin/init (執行一般開機後會執行的程序)
出现Authentication token manipulation error错误
OOOOOOOKAY i just fixed this my self:
After you type "init=/bin/sh" into cmdline.txt in the recovery boot up, and your RasPi has booted up, you
should be on the cmd line. BEFORE you type "passwd pi" , type
mount -rw -o remount /
then try changing the password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment