Articles in this section

Plesk Repair Kit shows warning: There are files or directories with suspicious permissions in the root directory of the domain

kb: bug Plesk for Linux

Applicable to:

  • Plesk for Linux

Symptoms

One of the following warnings is 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.

if user experience should be improved, please create a new PPS.

Resolution

Set default permissions for files (644) and directories (755) inside domain's document root:

Note: If a directory or file require special permissions, these commands may be omitted and the warning/error in Repair Kit can be ignored.

  1. Connect to your Plesk server via SSH.
  2. Obtain the document root directory and the system username of a domain:

    Note: Replace example.com with a domain name in question.

    # plesk db "select name, login, www_root from domains join hosting on domains.id=hosting.dom_id join sys_users on hosting.sys_user_id=sys_users.id where name='example.com'"

    Sample output:

    CONFIG_TEXT: +-------------+----------+--------------------------------------+
    | name        | login    | www_root                             |
    +-------------+----------+--------------------------------------+
    | example.com | john_doe | /var/www/vhosts/example.com/httpdocs |
    +-------------+----------+--------------------------------------+

  3. Using the information from step 2, replace the values (in bold) in the commands below and run them:
    1. Set default permissions for directories:

      # find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} \;

    2. Set default permissions for files:

      # find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} \;

Was this article helpful?

Comments

2 comments
Date Votes
  • There should be a 'plesk repair fs' option to fix that, shouldn't it?

     

    0
  • HI Luis this is a warning because some files inside the document root may needs permissions different to 755 or 644 according to your needs. If you run plesk repair fs -v -n you will see which files exactly.

    1

Please sign in to leave a comment.