[NTLUG:Discuss] Ubuntu's sudo (was: Rebuild installed packages)
Robert Pearson
e2eiod at gmail.com
Sun Dec 16 12:52:44 CST 2007
On Dec 16, 2007 11:43 AM, Robert Citek <robert.citek at gmail.com> wrote:
> On Dec 15, 2007 7:56 PM, <ntlug at thorshammer.org> wrote:
> > > > For anyone who feels "hamstrung" by the sudo mechanism for executing commands as root, I might
> > > > recommend the following:
> > > > sudo -s
> >
> > Personally I use "sudo su -", which probably accomplishes the same thing.
>
> Almost the same, but they are different environments. For example,
> try this command using both of the above options:
>
> # env | grep -ie home
>
> You'll notices that the home folder is different.
>
> > The only time I got burned by the sudo thing was when I changed the name for my only account without updating /etc/sudoers. I couldn't sudo with the new name and I hadn't set a root password.
>
> An alternate way is to use groups in the /etc/sudoers file. For
> example, to use the group admin:
>
> %admin ALL=(ALL) ALL
>
> then make sure your usename is part of the admin group.
>
> Regards,
> - Robert
That is handy to know.
I have used "sudo su -" since I discovered it.
In a prior Unix life I always used "su -" to be sure I only had the
"root user" environment.
Many people scoffed at this and only used "su" which gives root
privilege but keeps the "userid login" environment.
I just tested this only Ubuntu 7.10 with these results:
"sudo -s" - just like Robert says above.
"sudo su -" - [with "-"] gives "root id" and "root user" environment
"sudo su" - gives
More information about the Discuss
mailing list