How to Reset a Forgotten Root Password

Dan Nelson dnelson at allantgroup.com
Thu Apr 17 11:45:44 PDT 2003


In the last episode (Apr 17), dick hoogendijk said:
> >   then you should be able to boot up into single user mode
> >   with "boot -s" and change the password.
> > 
> >   You'll need to type "boot -s" at the secondary boot prompt
> >   (asks to press "any key" for another command ;)
> 
> In linux lilo.conf you could prevent this by putting a password on this
> bot option to "root" It sure is nice to have the option, but I feel a
> little insecure letting this door wide opten for everyone w/ access to
> the machine. Q: can this be protected?

Depends on what you want protected.  

Edit /etc/ttys and set console to "insecure" to prompt for the root
password after booting in single-user mode. (man ttys)

Edit /boot/loader.conf and add password="mypassword" to have /boot/loader
prompt for a password if someone hits space to abort autoboot. (man
loader, man loader.conf)

Edit /boot.config and add "-n" to ignore keypresses during the small
pause in boot2 before it execs /boot/loader. (man boot)

Also remember to remove the floppy and CD-ROM drives from the system
(or remove them from the boot path in the BIOS and password-protect the
BIOS if possible), and lock the case.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list