Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 2004 16:06:24 -0600
From:      Paul Schmehl <pauls@utdallas.edu>
To:        Andy Firman <andy@firman.us>, freebsd-questions@freebsd.org
Subject:   Re: bash - superuser
Message-ID:  <2147483647.1103904384@[192.168.2.101]>
In-Reply-To: <20041224155358.GB15993@akroteq.com>
References:  <41C6EE24.4080606@vilot.com> <200412202154.iBKLsrt13676@clunix.cl.msu.edu> <20041224155358.GB15993@akroteq.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--On Friday, December 24, 2004 6:53 AM -0900 Andy Firman <andy@firman.us> 
wrote:
>
> So for those of us that want to go back to the way things should be,
> (leaving root shell be /bin/sh)  I fire up vipw and change this:
>
> root:*:0:0:Charlie &:/root:/usr/local/bin/bash
>
> to this:
>
> root:*:0:0:Charlie &:/root:/bin/sh
>
> Right?
>
Correct.

> Then I keep using sudo all the time.  But if I need to do some big
> work as root, I can su to root and get bash simply by typing:
>
> /usr/local/bin/bash
>
> Right?
>
Correct.  However, there's one more thing you need to know.  When you use 
su, if you type "% su", you become root, but you are using *your* path.  If 
you want to use root's path, type "%su -".  That makes you root *with* 
root's path, and makes things much easier for you.

Then just type "% bash" at the prompt, and you are using bash as your 
shell.  The only "gotcha" (if you want to call it that) is that you have to 
type "% exit" twice to stop being root - once to get out of bash, and the 
second time to exit your su - session.

Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu



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