Applicable to:
- Plesk for Linux
Question
How to restore default permissions in virtual host directory on Plesk for Linux?
Answer
Note: solution for Plesk for Windows is available in the article How to restore default permissions on a domain in Plesk for Windows?
Since Plesk Obsidian 18.0.35, it is possible to change files and directories permissions in the Plesk interface:
- Log into Plesk.
- Go to Domains > example.com > File Manager.
- Click
next to a directory or a file and click Change Permissions.
- Set the permissions, enable the option Change permissions recursively if necessary, and click Save or Save and resume to apply the changes:
Note: The recommended permissions are 755 for directories (Read, Write, and Execute for owner, Read and Execute for group and others) and 644 for files (Read and Write for owner, Read for group and others).
-
Connect to the server using SSH.
-
Run the following commands:
Note: substitute example.com with the real subscription name and user_example with the system user of the subscription.
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} \;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} \;
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chown user_example:psacln {} \;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chown user_example:psacln {} \;
Comments
4 comments
Why do some files lose their rights at all? What is or can be a reason?
@F L E X 2 0 0 0 2 1 0 3
Hi!
Usually, this does not occur. In case you use CentOS, consider using audit.
Also, make sure you do not have any malware on the server.
Hi,
In case of "user_example" what would you recommend? not root right?
Also, how to avoid this happening in new installations? We by default use a custom WordPress media uploads folder, as ~/wp-uploads/ kind of sucks (sorry Matt), and this issue always pops out on custom WP folders in brand new installations.
Thanks
@Mario
As my colleague mentioned this does not happen normally. I recommend using audit to monitor permissions changes. Also, if you create custom folders make sure they have 755 permissions.
You can find "user_example" (system user) in Domains > example.com > System user:
Please sign in to leave a comment.