Applicable to:
- Plesk for Linux
Symptoms
One of the following warnings are reported by the Plesk Repair Kit extension or the command-line utility plesk repair fs
:
There are files or directories with suspicious permissions in the root directory of the domain 'example.com'.
There is incorrect ownership on some items in the WWW root directory of the domain example.com
One or more files or directories in the root directory of the domain 'example.com' are either writable by anyone or neither readable nor writable by the owner. Such permissions are insecure and may result in or indicate a security breach.
Cause
There are files and/or folders inside the domain's document root directory with incorrect permissions/ownership which cannot be fixed automatically.
There is a bug for improving the error in Plesk GUI https://jira.plesk.ru/browse/EXTPLESK-2875
Resolution
-
Connect to the Plesk server via SSH.
-
Fix permissions on files and directories inside the domains document root directory:
Note: If a directory or file require special permissions these commands may be omitted and the warning/errors from Repair Kit can be ignored.
Note: Replace example.com with an actual domain name.
# find /var/www/vhosts/example.com/httpdocs/* -type d -exec chmod 0755 {} \;
# find /var/www/vhosts/example.com/httpdocs/$* -type f -exec chmod 0644 {} \;-
If this is a subdomain, change the path:
# find /var/www/vhosts/example.com/subdomain_name/* -type d -exec chmod 0755 {} \;
# find /var/www/vhosts/example.com/subdomain_name/$* -type f -exec chmod 0644 {} \;
-
Comments
14 comments
Not working with Plesk 17.8.
Still says:
Error messages: 2; Warnings: 19; Errors resolved: 2
NO of the Warnings gets corrected.
There are files or directories with suspicious permissions in the
root directory of the domain
Hello Lenor,
I would like to inform you that "plesk repair fs" utility fix incorrect ownership and determines incorrect file permissions.
This behavior is by design because for some web application requires non-default permissions for files(644) and directories(755).
To set default permissions on directories and files inside the virtual host document root directory execute the following commands:
# find /var/www/vhosts/example.com/httpdocs/* -type d -exec chmod 0755 {} \;
# find /var/www/vhosts/example.com/httpdocs/* -type f -exec chmod 0644 {} \;
If this is a subdomain, change the path to the appropriate:
# find /var/www/vhosts/example.com/subdomain_name/* -type d -exec chmod 0755 {} \;
# find /var/www/vhosts/example.com/subdomain_name/* -type f -exec chmod 0644 {} \;
Hello,
I have a similar issue. I ran the Plesk Repair all -y and these commands -
find /var/www/vhosts/example.com/httpdocs/* -type d -exec chmod 0755 {} \;
find /var/www/vhosts/example.com/httpdocs/* -type f -exec chmod 0644 {} \;
But nothing worked. Some of my websites are showing up and some don't.
The warning shows for all my websites still.
What do I do?
Deepak
Hello Deepak, you should create a ticket to support to check the issue.
Hi Anton,
I did some stuff manually and corrected this issue. So this is solved.
Deepak,
I am experiencing the same issues across multiple plesk installations. Can you describe the manual stuff you did to correct the issues? Thank you for your help.
Need some help here please, on a new Plesk server I am migrating Cpanel to Plesk and found this issue happened on all accounts after migration, error like,
/var/www/vhosts/example.com/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/example.com/public_html/' is executable
I think this is a bug on Obsedian, how to do this step after migrating 100 accounts for example manually and how much time it will take?
Please make it easy to contact support to report similar issues, last time I contacted support involved many steps.
Another issue after migrating, Plesk now force SSL redirect and I can't test web sites on Plesk before I switch DNS, I think SSL redirect on new web sites isn't a good idea before we switch DNS so Plesk can issues SSL certs using for example let's encrypt!
Hello Fouad Ahmed Fouad,
Please submit a ticket to us https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
Would there be harm in doing this globally, that is,
find /var/www/vhosts/*/httpdocs/* -type d -exec chmod 0755 {} \;
for example?
Hello @Turgut Kalfaoglu
Yes, it is possible to perform this way. Please take a note, that execution time depends on number of domains/directories.
Hi Alexey,
It' not easy for me to contact support because I got a plesk license from a Plesk reseller.
And I believe this is a bug on migration manager, as happened to me twice on two different platforms when I migrated from Cpanel to Obsedian!
I just fixed manually permissions on all files and folders and issue solved!
@Fouad Ahmed Fouad
Thanks for letting us know. It does seem like a known bug with ID PPPM-12251. This bug will be fixed in one of the nearest Plesk releases. You may keep tracking of the Plesk Change Log to see when it will be fixed.
As a workaround, it is required to repair permissions manually for all domains using this command:
# plesk repair fs -y
Have permissions error wchich is neither fixed by plesk repair fs -y or plesk repair fs -verbose or commands mentioned before. Opening already 4th ticket with plesk, please fix that, we are getting google bots timeouts, that breaks our smart campaigns.
Jacek Swietochowski Hi!, i see in ticket 336176 that my colleague already replied to this. Plesk repair is only telling you that some permissions are too relaxed. You can choose to ignore this message if your files need "relaxed" permissions.
Please sign in to leave a comment.