Deleting files using www-data user

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm running an apache2 web server on raslberry pi 3 with raspbian stretch installed.
In case of unauthorized activity, I would like to delete all files saved at the apache's /var/www/html folder.
I can use the php exec() function, but to the best of my understanding it requires sudo permission which I'm not willing to give to www-data.
linux apache-httpd php
add a comment |Â
up vote
0
down vote
favorite
I'm running an apache2 web server on raslberry pi 3 with raspbian stretch installed.
In case of unauthorized activity, I would like to delete all files saved at the apache's /var/www/html folder.
I can use the php exec() function, but to the best of my understanding it requires sudo permission which I'm not willing to give to www-data.
linux apache-httpd php
Can you just use a simplesudo -u www-data rm -rf /var/www/html?
â Sparhawk
Sep 12 at 23:48
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm running an apache2 web server on raslberry pi 3 with raspbian stretch installed.
In case of unauthorized activity, I would like to delete all files saved at the apache's /var/www/html folder.
I can use the php exec() function, but to the best of my understanding it requires sudo permission which I'm not willing to give to www-data.
linux apache-httpd php
I'm running an apache2 web server on raslberry pi 3 with raspbian stretch installed.
In case of unauthorized activity, I would like to delete all files saved at the apache's /var/www/html folder.
I can use the php exec() function, but to the best of my understanding it requires sudo permission which I'm not willing to give to www-data.
linux apache-httpd php
linux apache-httpd php
edited Sep 13 at 4:34
Rui F Ribeiro
36.8k1273117
36.8k1273117
asked Sep 12 at 23:42
Mohsin Anees
1012
1012
Can you just use a simplesudo -u www-data rm -rf /var/www/html?
â Sparhawk
Sep 12 at 23:48
add a comment |Â
Can you just use a simplesudo -u www-data rm -rf /var/www/html?
â Sparhawk
Sep 12 at 23:48
Can you just use a simple
sudo -u www-data rm -rf /var/www/html?â Sparhawk
Sep 12 at 23:48
Can you just use a simple
sudo -u www-data rm -rf /var/www/html?â Sparhawk
Sep 12 at 23:48
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468673%2fdeleting-files-using-www-data-user%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can you just use a simple
sudo -u www-data rm -rf /var/www/html?â Sparhawk
Sep 12 at 23:48