[BBLISA] Reset root password on FreeBSD

Mathew Snyder mathew.snyder at gmail.com
Tue Oct 23 15:06:03 EDT 2012


Thanks. Unfortunately, running fdisk -p (-l is an invalid option) tells me
the "fdisk: mounted root fs resource doesn't match expectations (regexec
returned 1)"

Editing the /etc/shadow file requires getting past the problem with not
being able to mount the slice rw.

-Mathew

"When you do things right, people won't be sure you've done anything at
all." - God; Futurama

"We'll get along much better once you accept that you're wrong and neither
am I." - Me



On Tue, Oct 23, 2012 at 3:01 PM, Josh Boon <j at 80ok.be> wrote:

> I've never booted a FreeBSD system but from my rough googling you could
> just edit the hash directly.
>
> This md5 password hash would do for now.  The password is averageavenger
> #password generating command used
> md5pass averageavenger B32eK3KY
> #hash
> $1$B32eK3KY$dfZf8QJCEwQDNRJoapUEI/
>
> You'd have to find the physical device you're interested in
> #a good start
> fdisk -l
>
> and mount it directly to somewhere in the filesystem and then just edit
> the etc/shadow file in the mounted filesystem replacing the full hash for
> root with the one above and then you would login in using averageavenger as
> the pass when you reboot.  Do copy the shadow file
> cp etc/shadow{,.old}
> first.
>
> All the best,
> Josh
>
>
>
> ------------------------------
> *From: *"Mathew Snyder" <mathew.snyder at gmail.com>
> *To: *"Richard E.MGH Morse" <REMORSE at partners.org>
> *Cc: *"Bblisa at Bblisa. Org" <bblisa at bblisa.org>, "<kurin at delete.org>" <
> kurin at delete.org>
> *Sent: *Tuesday, October 23, 2012 2:50:23 PM
> *Subject: *Re: [BBLISA] Reset root password on FreeBSD
>
>
> I tried the toor option. Didn't work. I guess these people are smarter
> than the average vendor. ;)
>
> I've booted to installation media and selected the single-user mode. I've
> got the shell but when I attempt to follow the steps I've found on various
> sites it doesn't work. Generally, they all follow the same procedure:
>
> mount -a (or mount -u /)
> passwd
>
> However, this doesn't accomplish anything. when I look at df I'm only
> seeing the installation media and devfs as mounted. I looked at /dev but
> can't make out which, if any, of the entries are the partition I'm trying
> to mount.
>
> When I run passwd it seems to be executing from the installation media as
> it fails to change the password due to what I've ascertained is a problem
> making changes to a read-only filesystem. After I ran mount -o rw -a I get
> the same result.
>
> Any further help is appreciated.
> -Mathew
>
> "When you do things right, people won't be sure you've done anything at
> all." - God; Futurama
>
> "We'll get along much better once you accept that you're wrong and
> neither am I." - Me
>
>
>
> On Tue, Oct 23, 2012 at 1:53 PM, Morse, Richard E.MGH <
> REMORSE at partners.org> wrote:
>
>> You might also try using the 'toor' account -- this usually exists on
>> FreeBSD, although I forget if it needs a password -- but if the vendor
>> isn't paying attention they might have left this account unrestricted.
>>
>> Ricky
>>
>> On Oct 23, 2012, at 11:50 AM, Mathew Snyder wrote:
>>
>> > Thanks guys. I'm downloading an ISO right now.
>> >
>> > -Mathew
>> >
>> > "When you do things right, people won't be sure you've done anything at
>> > all." - God; Futurama
>> >
>> > "We'll get along much better once you accept that you're wrong and
>> neither
>> > am I." - Me
>> >
>> >
>> >
>> > On Tue, Oct 23, 2012 at 11:48 AM, <kurin at delete.org> wrote:
>> >
>> >> I haven't *tested* this, but I'm 99% sure it works:
>> >>
>> >> 1. Download a copy of the 9.0 install media.
>> >> 2. Boot to the 'live CD' option.
>> >> 3. Mount the root fs somewhere.
>> >> 4. chroot into it.
>> >> 5. `passwd`
>> >>
>> >> It's *possible* but not likely that the live CD will also want a
>> password,
>> >> in which case you can choose 'shell' instead of 'live CD'.
>> >>
>> >> On Tue, Oct 23, 2012 at 11:21:11AM -0400, Mathew Snyder wrote:
>> >>> We have a single FreeBSD server installed by a vendor. They have let
>> it
>> >> sit
>> >>> idle for who knows how long before coming around for a full
>> >> configuration.
>> >>> In that time, their default admin account has expired and no one kept
>> >> track
>> >>> of the root password. Now it needs to be reset.
>> >>>
>> >>> Unfortunately, they configured single-user mode to require said root
>> >>> password. This is quite a hinderance, naturally. I'm not familiar with
>> >> the
>> >>> BSDs. Can someone point me in the direction of instructions for
>> reseting
>> >> a
>> >>> password with boot media or something. Everything I've found online so
>> >> far
>> >>> assumes no password for single-user mode.
>> >>>
>> >>> -Mathew
>> >>>
>> >>> "When you do things right, people won't be sure you've done anything
>> at
>> >>> all." - God; Futurama
>> >>>
>> >>> "We'll get along much better once you accept that you're wrong and
>> >> neither
>> >>> am I." - Me
>> >>
>> >>> _______________________________________________
>> >>> bblisa mailing list
>> >>> bblisa at bblisa.org
>> >>> http://www.bblisa.org/mailman/listinfo/bblisa
>> >>
>> >>
>> >>
>> > _______________________________________________
>> > bblisa mailing list
>> > bblisa at bblisa.org
>> > http://www.bblisa.org/mailman/listinfo/bblisa
>>
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>
> _______________________________________________
> bblisa mailing list
> bblisa at bblisa.org
> http://www.bblisa.org/mailman/listinfo/bblisa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.bblisa.org/pipermail/bblisa/attachments/20121023/09663ac3/attachment-0001.htm 


More information about the bblisa mailing list