How to use sudo?

Len Lawrence <lcl-s9phx+4gxdMG2Il/[email protected]> Sun, 10 Jul 2011 21:48:48 +0100
Newsgroups gmane.linux.mandrake.newbie
Message-ID <[email protected]>
After 21 years with Unix/Linux I have decided to get to grips with the 
sudo command and have failed to get it to work.  Have read the man pages 
and experimented with the sudoers file but so far no luck.  For the time 
being I just want to run urpmi as a user.  The following is the 
/etc/sudoers file with a single line added.

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL
lcl    localhost= (root) NOPASSWD: /usr/sbin/urpmi, /usr/sbin/urpme

# Uncomment to allow people in group wheel to run all commands
# %wheel    ALL=(ALL) ALL

# Same thing without a password
# %wheel    ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

This syntax is accepted by visudo.
Then as lcl:

sudo urpmi whatever

This asks for a password.  lcl's password results in "lcl is not allowed 
to run sudo".
root's password is rejected.

What now?

Len


____________________________________________________
Want to buy your Pack or Services from Mandriva? 
Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________