Sudoers list?

VIGNESH vignesh1986 at gmail.com
Fri Apr 7 13:21:11 UTC 2006


How to add people to the sudoers list on Ubuntu as well as other distros ?

Cheers
Vignesh

On 4/6/06, Erik Christiansen <erik at dd.nec.com.au> wrote:
>
> On Wed, Apr 05, 2006 at 12:01:15PM +0200, Dennis Kaarsemaker wrote:
> > On wo, 2006-04-05 at 17:24 +1000, Matt Palmer wrote:
> > > That's far from a complete solution -- I might grant a specific
> > > privileges in /etc/sudoers because I want to use some of the many
> > > features that sudo provides to manage the granting of privileges (and
> > > ain't there a *lot* of them!)
> >
> > True, but short of writing your own parser for /etc/sudoers and having
> > root access to read it, there's no way to reliably do something even
> > remotely like checking whether a user can use sudo to run a specific
> > command.
>
> If sudo has timed out, the password is required before the privileged
> install action can be effected. By asking for it in time to use it for
> the "am I a sudoer" query (sudo -v), it is still only entered once, and
> the script can choose the install path based on this information, as
> Daniel seems to need. e.g.:
>
> #!/bin/bash
> echo "Please authenticate this install. (If sudo has timed out):"
> sudo -v
> if [ $? -eq 0 ] ; then
>    echo Can use privileged directories.
>    sudo touch /home/elephant              # <- Install action (2nd sudo)
> else
>    echo Cannot use privileged directories.
> fi
>
> For a sudoer, this rips straight into the privileged install if
> sudo has not timed out, but after a password prompt if it has.
> If the password attempts fail, or when used by a non-privileged user,
> the non-privileged path is taken.
>
> Testing for privileged user:
> ----------------------------
> $ /tmp/fred
> Please authenticate this install. (If sudo has timed out):
> Password: <fumble & ^C out>
> Cannot use privileged directories.
>
> $ /tmp/fred
> Please authenticate this install. (If sudo has timed out):
> Password: <correct password>
> Can use privileged directories.
>
> and unprivileged:
> -----------------
> $ sudo su nobody
> sh-3.00$ /tmp/fred
> Please authenticate this install. (If sudo has timed out):
> Password:
> Sorry, user nobody may not run sudo on dvalin.
> Cannot use privileged directories.
>
> This seems to be fairly close to checking whether a user can use sudo to
> do what Daniel requires, IIUC.
>
> Erik
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060407/2f2af5c2/attachment.html>


More information about the ubuntu-users mailing list