Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

1 Answer 1

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.