Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sudo

Status
Not open for further replies.
May 3, 2002
633
US
How do you configure the /etc/sudoers file to allow a user to run `kill -3` but not allow a `kill -9`?

Thanks
 
I do not believe you can.

What you can certainly do is write a script that then executes kill -3 with the PIDs passed and allow users to run that script.
 
I agree. You can only deny or allow access to the kill command. You can not specify switches. Writing the script is the easiest way to do it.
 
As listed from the sudo site itself:

A Cmnd_List is a list of one or more commandnames, directories, and other aliases. A commandname is a fully qualified filename which may include shell-style wildcards (see `Wildcards' section below). A simple filename allows the user to run the command with any arguments he/she wishes. However, you may also specify command line arguments (including wildcards). Alternately, you can specify "" to indicate that the command may only be run without command line arguments. A directory is a fully qualified pathname ending in a '/'. When you specify a directory in a Cmnd_List, the user will be able to run any file within that directory (but not in any subdirectories therein).

If a Cmnd has associated command line arguments, then the arguments in the Cmnd must match exactly those given by the user on the command line (or match the wildcards if there are any). Note that the following characters must be escaped with a '\' if they are used in command arguments: ',', ':', '=', '\'.

Check the site itself:


Regards,
Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top