[colug-432] Prevent SU from changing CWD

Rob Funk rfunk at funknet.net
Wed Mar 9 09:40:35 EST 2011


On Wednesday, March 09, 2011 09:38:15 am Jason Marshall wrote:
> The '-' in the 'su -' command you are running forces a login shell when the
> command executes, loading root's environment and parking you in his home
> directory.
> 
> If you run it without the hyphen, you will be root, but without the other
> environment variables set (PATH, etc.). This will also keep you in the
> current directory.

On the other hand, if you just want to have a root shell where you are, with 
your usual shell environment, "sudo -s" generally suffices.


More information about the colug-432 mailing list