bash - superuser

Paul Schmehl pauls at utdallas.edu
Fri Dec 24 14:06:27 PST 2004


--On Friday, December 24, 2004 6:53 AM -0900 Andy Firman <andy at 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 at utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu


More information about the freebsd-questions mailing list