Subject: Re: changing root shell hell
To: Nicholas Jackson <nicholasj@ncafe.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 12/26/2003 21:22:48
On Fri, 26 Dec 2003, Nicholas Jackson wrote:

> I'm a NetBSD newbie and it appears that I've made a very stupid
> mistake. I accidentally changed root's shell to an invalid shell using
> chpass and now I'm unable to su to root.
>
> I have the correct password and the system accepts it, however, when I
> attempt to su to root, I am immediately dropped back into the unpriv.
> user's shell with an 'invalid shell'. The log does show a momentary su
> to root, though..
>
> Is there something I can do? I'd hate to lose the work I've put into
> this install..

Start in single user mode, and when it asks you for a shell, type
"/bin/sh". Then from the shell, "fsck -p", followed by "mount -a",
"export TERM=vt220", and then you can run "vipw" or "chpass".

The bootstrap method is different for each port, so if you have
trouble figuring out how to start in single user mode, do say which
port you're running.

Frederick