[BlueOnyx:03750] Re: can't su to root after reboot

Chuck Tetlow chuck at tetlow.net
Mon Mar 1 23:32:46 -05 2010


> 
> super user is root. 
> 
> su by itself works and leaves you in whatever directory you do it from. 
> su - by itself works and puts you in /root and loads root .bash_rc 
> 
> su root works and is the same as su 
> su - root works and is the same as su -

The hyphen (or minus sign) behind the su command tells the system to assume the properties of that user - their home directory, login profile, environment, aliases, etc...  If you leave it off, you don't get the full ability of that user.  So you can "su jdoe" to simply change to jdoe's account, or "su - jdoe" to also assume their environment, path, etc...

If you leave the hyphen off when switching user to root, you won't get full root privileges and abilities.  I always use "su -".

Chuck

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20100301/755c2c82/attachment.html>


More information about the Blueonyx mailing list