Question

opensuse 12.1

I'm creating a file in /etc/sudoers.d/ called access. The permissions are set at 0440 This works fine.

Currently the file has just this in it:

www ALL=(ALL) NOPASSWD: ALL

Which allows my web scripts to run anything as root without a password. ( I know it's not secure )

I'd like to allow www to run as root with out a password for 3 scripts only.

/application/local/dev/install -lan
/application/local/test/install -lan
/application/local/support/install -lan

Can that be done ?

Was it helpful?

Solution

I tried this and it worked :)

I created a plain text file and added the following

www ALL=(ALL) NOPASSWD: /application/local/dev/install -lan
www ALL=(ALL) NOPASSWD: /application/local/test/install -lan
www ALL=(ALL) NOPASSWD: /application/local/support/install -lan

I then set the files permissions to 0440 and copied to to /etc/sudoers.d/

Following that my www user still has root access to these files with out a password, but not to anything else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top