Bonjour,
J’aimerais que mon utilisateur apache (www-data) via php, exécute en chown.
Seulement, chown est réservée aux super-utilisateurs.
J’essaie donc d’ajouter des privilèges à mon utilisateur www-data en éditant /etc/sudoers :
www-data ALL=NOPASSWD: /bin/chown user\:group /home/www/[a-zA-Z0-9]*
Cette ligne ne fonctionne pas.
Dans mon log d’erreur d’apache, j’ai :
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for www-data:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for www-data:
Alors que je précise justement NOPASSWD.
Mon code PHP :
exec ('sudo chown -R user:group '.$path);
Une idée ?
Merci d’avance pour vos réponses,
Pierrot