Deleting files using www-data user

The name of the pictureThe name of the pictureThe name of the pictureClash 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.










share|improve this question























  • Can you just use a simple sudo -u www-data rm -rf /var/www/html?
    – Sparhawk
    Sep 12 at 23:48














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.










share|improve this question























  • Can you just use a simple sudo -u www-data rm -rf /var/www/html?
    – Sparhawk
    Sep 12 at 23:48












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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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















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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)