Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2000 19:09:54 -0500 (CDT)
From:      Brennan W Stehling <brennan@offwhite.net>
To:        Vonnie Gurgin <vg@vg-consult.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: I have managed to loose root access on my own system
Message-ID:  <Pine.BSF.4.10.10005061858490.69002-100000@home.offwhite.net>
In-Reply-To: <4.1.20000506165038.009fbc60@idiom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I believe you can get in with single user mode.  Just reboot the machine
and when it is about the go into the second phase of the boot process stop
it by hitting anything Enter.

The enter the following command.

--

boot -s

--

This will take you into single use mode.  When it gets further along it
will ask you for a shell.  Use the default, which I think is /bin/sh.

Next you next to get the filesystem up so you can edit the files.  Maybe
this part is options since you are editing files in /etc, but I would do
this just to be sure.

--

fsck -p
mount -u /
mount -a -t ufs

--

Then edit the password file as you did before and be sure to get the
correct shell.

For me, I leave the root shell alone and create an alternate root user
called rootb.  I set it to the shell I want and the home directory that I
want with all of the settings that I want.  The user id is still 0 and I
am still effectively root as that user.  I can perform any root functions.

I originally did this when I was one of two sys admin and I preferred the
bash shell while the other sys admin liked csh.  It is also nice to have
backup root account in case you mess one up, especially for remote
adminstration.


Brennan Stehling - web developer and sys admin
projects: www.greasydaemon.com | www.onmilwaukee.com | www.sncalumni.com

Microsoft: Will you get a macro virus today?

On Sat, 6 May 2000, Vonnie Gurgin wrote:

> Do'h  I tried to change the shell for root.  
> 
> Now when I try to su to root I get:
> 
> su: usr/local/bin/tcsh: No such file or directory
> 
> All advice/help will me greatly appreciated!
> 
> Thanks -- Vonnie
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10005061858490.69002-100000>