On Tue, Mar 20, 2001 at 01:08:22PM +0000, David Cantrell wrote:
> A quick question for all the BSD people.
> 
> How do I boot NetBSD into single-user mode?  In case it matters, this is
> on Sparc.
> 
> A pint for whoever helps me reset the root password :-)

    ok boot -s

You may need variations on this to boot from the correct device (eg:
"boot cdrom -s".  This assumes you have a v2 prom or newer, which you
probably do (my old sparc 2 has one).

Resetting the root password is not too difficult, I think (I'm more
used to FreeBSD, this will /probably/ work.  Once booted into single
user mode, do:

    # mount -u /
    # ed /etc/master.passwd
    1s/:[^:]*/:/
    p
    w
    q
    # pwd_mkdb /etc/master.passwd
    # exit

And it should come back up in multi-user mode, with root having no
password.  The pwd_mkdb command recreates the /etc/pwd.db and
/etc/spwd.db databases, which is just used for quick lookup.  Normally,
you'd use vipw(8) and get this done automatically.

I'm not totally certain things are the same on NetBSD, but you should be
able to get going, by looking at this and the man pages on
www.netbsd.org.

-Dom

Reply via email to