FreeBSD reset or recover root password

来源:互联网 发布:东海县 知乎 编辑:程序博客网 时间:2024/05/30 23:56

http://www.cyberciti.biz/tips/howto-freebsd-reset-recover-root-password.html

 

Next you will see following prompt from system:
When prompted Enter full pathname of shell or RETURN for /bin/sh:

Press Enter key to boot into single user mode. Next, you will be immediately dropped into a single user mode without a root password.

You need to remount / (root) file system in read and write mode with mount command, type following two commands:
# mount -u /
# mount -a

Setup a new password with passwd command:
# passwd

Next type exit command to boot FreeBSD into multi-user mode environment:
# exit
OR You can just reboot the system:
# sync;sync
# reboot

For more information read man pages of passwd and mount command.

原创粉丝点击