[OT] sudo, why not su?

Derek Broughton news at pointerstop.ca
Mon Aug 8 17:27:20 UTC 2005


Sean Miller wrote:

> I have been using both sudo and su in a professional environment for
> about 10 years... I have never considered them to be in any way the same
> thing... neither has a benefit over the other because they do different
> things.

I don't buy that.
> 
> su
> ----
> su switches user. 

like sudo -i (or sudo -i -u user)

> It creates a new shell process spawned from the one it 
> is called from which is logged in as the requested user (if none is
> specified this is root).  When you su to another user you have to enter
> their password unless you are logged as root when you issue the command
> in which case you do not. This is because of the heirarchy... root is
> the super-user, others do not have this privilege.

Still like sudo -i
> 
> sudo
> --------
> sudo runs a single command as the root user. In its "ubuntu" incarnation
> it has a lot of access to commands whereas in its purest incarnation it
> does not.

While the more generic sudo doesn't have a -i option, I think you can get
there with -s or -c (as long as the /etc/sudoers file permits it)

> The values in /etc/sudoers are changed by root by issuing the command
> "visudo"... 

Vi bigots...  :-) mine use joe

> the Ubuntu setup as supplied by default basically gives the 
> first user set up during install carte-blance to run anything as root.
> This is not really what sudo is designed for but is a novel way of
> giving folks the ability to administer every aspect of their Ubuntu
> install without ever having to go to a root shell.

_Somebody_ has to have full root access to everything :-)
-- 
derek





More information about the ubuntu-users mailing list