Resetting the root password
As I mentioned above, resetting the root password and gaining administrative access to the machine requires local access to the server. Following the steps below should put you at an administrative prompt where you will be able to run the ‘passwd’ command to reset the password to a known value.
- Restart the server.
- When the “Welcome to FreeBSD” menu appears, press the [SPACEBAR] to pause the boot countdown.
- Select “4” which should be: Boot FreeBSD in single user mode.
After the machine boots you should be presented with a prompt:
When prompted Enter full pathname of shell or RETURN for /bin/sh:
Press the enter key, or enter the full pathname of your preferred shell. At this point you should be at a shell prompt, as the root user. The remaining step is to reset the password to a known value.
In order to make this change you’ll need to remount the filesystem(s) in read-write. Use the following two commands to make this change:
mount -u /
Finally, reset the root password using the passwd command:
At this point you should be able to reboot the machine, or type ‘exit’ to continue the boot process into its normal multi-user environment.
If you have problems regarding the “passwd” command not being found, or other similar issues, you may need to ensure that you have properly mounted any additional file systems. I might suggest using:
To ensure that your /usr partition is mounted (assuming it is on a separate partition).