I need to give permission to a local user to run an installation script that requires root privilege. So I created a special group in which this user is a member of and gave the permissions to the install script as follows:
# chown -R root:grpx install.sh
# chmod 750 install.sh
-rwxr-x--- 1 root grpx 450 Sep 21 2012 install.sh*
This is to ensure that the read-execute permissions are available while write permission is denied so that elevation of power is not abused.
Now I had used setuid
to give elevated privilege.
# chmod 4750 install.sh
[root@hp codeathlon]# ls -lrt install.sh
-rwsr-x--- 1 root grpx 450 Sep 21 2012 install.sh*
Despite this I get Operation not permitted
errors when I try running the script as the user. Is this because the internal script commands are still run as the original user and not the root? If so please advise me on circumventing this problem.