1

I wanna run some script with root priviliges but by apache user. So I added SUID bit to script file but this doesn't work as I expected.

Script file owner is root.

rwsr-xr-x  1 root  root  2438 paź  8 12:10 script.sh

When I run this from bash as root everything works fine... but when I run this as apache user(it's launched by svn hook post-coomit script runing as apache) I'm getting some permission denied messages.

This is strange to me or I misundestood the mining of SUID bit. (users will get file owner’s permissions as well as owner UID and GID when executing a file/program/command.)

So what is the difference. Should I add proper line to /etc/sudoers that will enable runing that script as root...

1 Answer 1

2

In most enviroments, bash scripts (and most other) cannot be run as SUID (due to severe security issues*).

If you only need a couple of commands run as root, you can edit /etc/sudoers to allow the apache process to run just those specific commands as root.

*http://www.vidarholen.net/contents/blog/?p=30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .