106 reputation
16
bio website
location
age
visits member for 3 years
seen Dec 10 at 17:47

Aug
3
awarded  Notable Question
Mar
15
awarded  Supporter
Oct
13
awarded  Popular Question
Aug
29
awarded  Commentator
Aug
29
answered MAMP Vhosts Slow
May
29
awarded  Tumbleweed
Dec
12
revised PHP script needs permission to run a sudo command with shell_exec()
Added updated sudoers file
Dec
12
comment PHP script needs permission to run a sudo command with shell_exec()
I actually tried this, and for some reason it didn't work with the full path. I've got it working currently, but with this: Emerson ALL=(ALL) NOPASSWD: ALL I'm not happy about it because it seems too permissive to be safe. Am I wrong about that?
Dec
12
revised PHP script needs permission to run a sudo command with shell_exec()
Added new test resutls
Dec
12
comment PHP script needs permission to run a sudo command with shell_exec()
Update. It still didn't work. I still have to open/re-save etc/sudoer to keep my script working. It sounds like the requiretty flag should be off by default anyway.
Dec
12
comment PHP script needs permission to run a sudo command with shell_exec()
Update. It didn't work with username. I'm testing it as follows: Defaults:www-data !requiretty
Dec
12
comment PHP script needs permission to run a sudo command with shell_exec()
I don't have a /var/log/auth.log but I do have a /var/log/secure.log. I took a look at the entries from the past 36 hours. Nothing seems to be relevant, but I'm also not sure what I should be looking for? Would it be appropriate to add the contents to my post?
Dec
12
comment PHP script needs permission to run a sudo command with shell_exec()
I just want to make sure I understand your code. Is the colon at the end of "Defaults:" correct? Your syntax is a bit different than the other defaults in my current file. Also, is "username" a placeholder for an actual username? Like www-data? Sorry if these are dumb questions. My understanding of this syntax is poor.
Dec
12
awarded  Student
Dec
11
comment PHP script needs permission to run a sudo command with shell_exec()
I added the contents of my sudoers file above (I don't think that's unsafe). There does not appear to be a requiretty line. I agree, I should make the permission more specific by adding /bin/lessc to the end of the path.
Dec
11
awarded  Editor
Dec
11
revised PHP script needs permission to run a sudo command with shell_exec()
Added my sudoers file
Dec
11
asked PHP script needs permission to run a sudo command with shell_exec()