Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
ubuntu: let a user run a script with root permissions

Hi all,

I need a script that will chown/chmod some files. This script need to be executable by any user.

The problem is that those files are owned by different users, so it needs to be executed as root.

I tried the SUID so that any users with X permission can execute the script as root, but seems that it doesn't work with a bash script because of security issue.

How can I do that ? thanks.

share|improve this question

marked as duplicate by Kyle Brandt, Warner, splattne Jun 16 '10 at 14:34

This question was marked as an exact duplicate of an existing question.

You want sudo for this, see the possible duplicate link above. – Kyle Brandt Jun 16 '10 at 13:55

If your users are listed in /etc/sudoers:

sudo scriptname
share|improve this answer
The user is member of a group 'adm', and in visudo I have : %adm ALL=(ALL) ALL – Bastien974 Jun 16 '10 at 14:19
In fact, I don't want the user to write in a password to sudo, is that possible to do it another way ? I just want him to execute the script and that's it. – Bastien974 Jun 16 '10 at 14:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.