Staviar
Posts: 40
Joined: Tue Sep 10, 2019 9:51 am

[SOLVED]Can I specify folders in "visudo" instead of individual files ?

Thu Oct 03, 2019 8:44 am

Hello !

I am trying to give run some "sh" scripts from a php interface. In order to do this I need to give root permissions to "www-data". In order to do this I have ran "sudo visudo" and I have added the following line:
"www-data ALL=NOPASSWD: /var/www/html/scripts/"

It seems that it works, but I am not positive that this is correct. :!: :?:

:?: :?: :?:
Do I need to specify each file or I can specify a whole directory ?
:?: :?: :?:

Thank you !
Last edited by Staviar on Fri Oct 04, 2019 8:02 am, edited 1 time in total.

fbe
Posts: 644
Joined: Thu Aug 17, 2017 9:08 pm

Re: Can I specify folders in "visudo" instead of individual files ?

Thu Oct 03, 2019 1:24 pm

The man page says:
When you specify a directory in a Cmnd_List, the user will be able to run any file within that directory (but not in any sub-directories therein).

Staviar
Posts: 40
Joined: Tue Sep 10, 2019 9:51 am

Re: Can I specify folders in "visudo" instead of individual files ?

Fri Oct 04, 2019 8:02 am

fbe wrote:
Thu Oct 03, 2019 1:24 pm
The man page says:
When you specify a directory in a Cmnd_List, the user will be able to run any file within that directory (but not in any sub-directories therein).
I am still not used to the man pages. That was an easy information to find. Thank you !

Return to “Beginners”