# Lost Root Password



## yoda_man (Jun 30, 2011)

We have a FreeBSD 8 system that was built by someone else who has now left.  He set up a root password as well as locked the boot loader so we can not boot into single user mode nor can we access the system since we do not know the root password.  

We can boot off a CD and get into fixit but the drives are set up as a UFS mirror.  How can I mount the UFS mirror from fixit so that I can change the root password? 

Thanks!


----------



## jrm@ (Jun 30, 2011)

yoda_man said:
			
		

> He ... locked the boot loader



Do you mean he put in a BIOS password?  If so, I've gotten around those by popping the battery out of the motherboard.

EDIT: You probably mean something else since you can boot off a CD.  Maybe mounting something similar to /dev/mirror/gm0s1a?  You'll also have to `# kldload geom_mirror`. I haven't done this in a while so I'm probably forgetting something.  

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html might also be useful.


----------



## SirDice (Jun 30, 2011)

mingrone said:
			
		

> Do you mean he put in a bios password?


You can password protect the loader(8). See loader.conf(5)

And you can set the console to "insecure" in /etc/ttys.

But yes, load geom_mirror. Mount the filesystem and edit /boot/loader.conf to remove the password and/or edit /etc/ttys and set console back to "secure". 

After that you should be able to boot to single user mode.


----------



## yoda_man (Jun 30, 2011)

Thanks for the reply!

He passworded the loader.conf.  So when I boot to single-user mode it prompts for a password.  I'll see what I can do once I boot to fixit and load the geom_mirror.

Thanks again.


----------



## SirDice (Jun 30, 2011)

yoda_man said:
			
		

> So when I boot to single user mode it prompts for a password.


That's most likely the edit done in /etc/ttys.

A loader password would be asked just before the loader menu.


----------



## yoda_man (Jun 30, 2011)

Thank you SirDice, that is what it was!  

For anyone else this is what I did.

1) boot to CD and select 'repair'
2) select 'repair with CD, Floppy, or USB' (I select CD since that is what I was booting with)
3) once the fixit loads type 
`kldload /mnt2/boot/kernel/geom_mirror.ko`
4) `fsck_ufs /dev/mirror/(mirror id)`
5) `mount /dev/mirror/(mirror id) /mnt`

Thanks


----------

