WordPress security issue related to file manager plugin

Posted March 7, 2020 1.2k views
NginxApacheWordPressSecurityLAMP StackLEMPDevelopment


I had installed two WordPress sites on same DigitalOcean server (Ubuntu + Nginx + Mariadb + php-fpm).



Now problem is that file manager plugin installed on one WordPress site can read and edit files of another site.

Example: Plugin of WordPress at /var/www/html and edit files of /var/www/html2

Is there any way to restrict access of file manager plugin of one WordPress to installation_folder of that WordPress only?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @rishi008tiwari,

One of the benefits of PHP FPM is that is can run PHP scripts with different users. What you could do is add different users for each website and create separate PHP FPM configs for each website.

For more details I would strongly recommend checking out this tutorial here on how to do this step by step:

Hope that this helps!

by Toli
It's well known that the LEMP stack (Linux, nginx, MySQL, PHP) provides unmatched speed and reliability for running PHP sites. Other benefits of this popular stack such as security and isolation are less popular, though. In this article we'll show you the security and isolation benefits of running sites on LEMP with different Linux users. This will be done by creating different php-fpm pools for each nginx server block (site or virtual host).
  • Hi @bobbyiliev

    I’m using these permissions so that WordPress can install plugins and edit its own files:-

    sudo usermod -a -G site1 www-data
    sudo chgrp -R site1 /var/www/site1/
    sudo chmod -R 775 /var/www/site1/

    Now site1 can’t edit folders and files of site2 (it can edit files of /var/www/site1 folder only).

    But problem is that site1 can still download and view files of site2. How can I prevent this?

    Please let me know if this is possible.