寫教學的最大目的是教會未來的自己

FreeBSD忘記密碼解決方法

有些時候,會剛好接手道 資料不全的server,就有機會碰到 帳號密碼消失

最近剛好碰到,找了一下方法 記錄下來

資料來源:http://www.hkcode.com/linux-bsd-notes/399

 

1. 重新開啟 FreeBSD 主機。

2. 在 "Welcome to FreeBSD!" 開啟選單中按 "4" 選擇 "Boot FreeBSD in single user mode"。

3. 然後會看到 "When prompted Enter full pathname of shell or RETURN for /bin/sh:",直接按 Enter。

4. 這時便會直接進入 single user mode,輸入以下指令重新掛載根目錄 "/" 為可讀寫:

# mount -u /
# mount -a

5. 用 passwd 重新設定 root 密碼:

# passwd

6. 最後重新啟動即可:

# reboot

 

 

如果mount 出現問題

請先執行fsck -y

Post to Twitter Post to Plurk Post to Facebook Send Gmail

發表迴響

Copyright © 2024. All Rights Reserved.

歡迎光臨
初音