Applicable to:
- Plesk for Linux
Question
How to restore the permissions and ownerships of Plesk installation directory to the default ones?
Answer
Warning: This guide is applicable only for RHEL/CentOS/CloudLinux systems.
Connect to the server using SSH. Permissions and ownerships can be reset to their default settings using the following commands:
# for p in $(rpm -qa | egrep "psa|plesk"); do rpm --setugids $p; done
# for p in $(rpm -qa | egrep "psa|plesk"); do rpm --setperms $p; done
# chown root.psaadm /usr/local/psa/admin/sbin/mod_wrapper
# chmod 4510 /usr/local/psa/admin/sbin/mod_wrapper
Note: The order in which you execute the commands is important. When changing permissions and ownerships on files, always change the ownerships first, and then the permissions. Otherwise, if the files have a SUID bit set, for example, it (the bit set) may get cleared.
Additional Information
Sometimes Mailman still fails to work after applying the above solution. The following messages can be found in the /var/log/maillog:
CONFIG_TEXT: qmail: 1342049843.229677 delivery 3: deferral: Uh-oh:_.qmail_file_is_writable._(#4.7.0)/
qmail: 1342049843.229737 status: local 4/10 remote 1/20
There are 3 possible ways of resolving it:
-
Run following set of commands:
# rpm --setugids mailman-<INSTALLED_VERSION>
# rpm --setperms mailman-<INSTALLED_VERSION>Replace
<INSTALLED_VERSION>
with the actual version of Mailman package installed on your server. -
Try switching mail provider to Postfix and check if the behavior changes.
-
Try uninstalling Mailman (Warning, this will lead to loss of all configuration), install it back and configure it anew.
In case all those action do not help, make sure that Plesk installation is up-to-date. Update it if necessary.
Comments
4 comments
А для Ubuntu Как сделать то же самое?
Добрый день, @Netgs!
Совершенно аналогичного способа для Ubuntu, к сожалению, нет.
Можно попробовать сделать plesk repair fs, для большей части файлов Plesk это должно помочь (в случае Plesk Onyx 17.8).
Директорию mailman, однако, эта команда не затронет, для неё единственным способом будет восстановить владельца и группу вручную.
The command
# chown root.psaadm /usr/local/psa/admin/sbin/mod_wrapper
resets the SUID bit (as explained in the blue box on this help page) :
-r-x--x--- 1 root psaadm 29656 19 févr. 11:30 /usr/local/psa/admin/sbin/mod_wrapper
So it should not be done, or not without this next command :
# chmod 4510 /usr/local/psa/admin/sbin/mod_wrapper
-r-s--x--- 1 root psaadm 29656 28 nov. 23:34 /usr/local/psa/admin/sbin/mod_wrapper
The command "plesk repair fs" also corrects permissions for this file if needed.
Please update this guide accordingly
Thank you ! :)
@Benoît Oua
Thank you for noticing.
I've added the 'chmod' line to the article.
Please sign in to leave a comment.