john 192.168.1.87=/usr/bin/users-admin
If you want to give the editor group system-wide permission with no
password required to delete files, you use the following:
Click here to view code image
%editors ALL=NOPASSWD: /bin/rm
If you want to give every user permission with no password required to
mount the CD drive on the localhost, you do so as follows:
Click here to view code image
ALL localhost=NOPASSWD:/sbin/mount /dev/scd0 /mnt/cdrom /sbin/umount
/mnt/cdrom
It is also possible to use wildcards in the construction of the sudoers file.
Aliases can be used, as well, to make it easier to define users and groups. The
man page for sudoers contains some examples, and
[http://www.komar.org/pres/sudo/toc.html provides illustrative notes and comments](http://www.komar.org/pres/sudo/toc.html provides illustrative notes and comments)
about sudo use at a large company. The sudo home page at www.sudo.ws is
also a useful resource for additional explanations and examples.
The following command presents users with a list of the commands they are
entitled to use:
Click here to view code image
matthew@seymour:~$ sudo –l
ADDING EXTRA sudo USERS
As mentioned earlier, by default Ubuntu grants the first created user full
root access through the sudo command. If you need to add this capability
for other users, you can do so easily by adding each user to the admin
group (in Ubuntu 11.10 or older) or the sudo group (any release after
12.04) or by using the User Manager tool to allow them to administer the
system, which can be found in the User Privileges tab when you edit the
properties for a user. The group change is described in this comment from
the official release notes for Ubuntu 12.04: “Up until Ubuntu 11.10,
administrator access using the sudo tool was granted via the admin Unix
group. In Ubuntu 12.04, administrator access will be granted via the sudo
group. This makes Ubuntu more consistent with the upstream
implementation and Debian. For compatibility purposes, the admin group
will continue to provide sudo/administrator access in 12.04.”