[Gllug] re: use of sudo

Bruce Richardson itsbruce at uklinux.net
Fri Jul 2 12:42:13 UTC 2004


On Fri, Jul 02, 2004 at 12:43:21PM +0100, t.clarke wrote:
> Does 'sudo' actually run commands as root without having to enter a
> password ?

It can but this does not have to be a security hole.  The important
thing to remember is that sudo does not let people execute arbitrary
commands, only those commands which have been explicitly allowed in the
sudoers configuration file.  

> 
> If a file is writeable only by root, I assume there is a good reason for it.
> 
> You should only be able to write to that file either by 'being' root or
> assuming root permissions after entering (usually) the root password
> blindly on the screen.

That approach means that you have to hand out the root password to
anybody who is going to have any administrative role of any kind.  Sudo,
on the other hand, allows you to create an arbitrary collection of tasks
and permit specific users to run them as root (or as some other particular
user).

As for passwords, the default in sudo is to require the user to provide
their own password, rather than root's password.  This is much more
secure.  You can specify that some commands may be executed without a
password, if you choose.  Myself, I never use this for human users who
will be working interactively but I have had occasion to use it where a
script or automated process needs to perform a priveleged action and
would not otherwise be able to do it (possibly because it will be
running as the webserver user, for example).  Allowing passwordless
execution through sudo is much safer then making the relevant tool suid.

Sudo can be a security hole if improperly used but then the same goes
for chmod.  Properly used, Sudo enhances security and allows you to
transcend the limits of the standard Unix security model, which is very
limiting.

Hmm.  Maybe sudo is a suitable subject for a lightning talk.

-- 
Bruce

A problem shared brings the consolation that someone else is now
feeling as miserable as you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20040702/dd2227cb/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list