Search code examples
wordpressazureazure-web-app-service

Cannot change permission of azure app service linux directory


I have a WordPress blog hosted on Azure App Service Linux. I am unable to change either directories or files. Has anyone experienced the same issue? It has resulted in my blog being hacked multiple times.

enter image description here

I have root user. change directory permission using find . -type d -exec chmod 755 {} \;

and files using find . -type f -exec chmod 644 {} \;


Solution

  • I'm going to take a guess here, but my hunch is that this is the issue (from this link):

    When you persist storage with the WEBSITES_ENABLE_APP_SERVICE_STORAGE app setting, we mount a location in Azure Storage to the /home mount point. The permissions on this are 777. You cannot change these permissions, even if you attempt to do so from an initialization script or from SSH.

    Be careful with this app setting. If you set it to FALSE, the contents of the filesystem will be deleted after each restart. See here for details.

    Also, see this link