root user
Smoot Carl-Mitchell
smoot at tic.com
Mon Jan 2 04:08:18 UTC 2012
On Sun, 2012-01-01 at 20:13 -0700, Craig White wrote:
> > The best way is to use sudo to become root:
> >
> > jay at polar:~$ sudo su
> > ----
> recommend that you use 'sudo su -'
>
> note the dash at the end which obtains root env... can definitely make a
> big difference.
Or on most modern version of sudo just use the -i option. It does the
same thing.
Please note the "su" command lets you become any user and not just root.
e.g.
sudo -i -u foo
will give you a shell with the authorization of the user "foo". You can
do the same thing for an individual command with:
sudo -i -u foo somecommand
The -i insures you get the user's environment e.g. PATH and other
environment variables and behaves just like you logged in as the user
"foo".
--
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
smoot at tic.com
More information about the ubuntu-users
mailing list