Fix or Reset Broken Permissions in DirectAdmin

Posted on

Hi, there might be a situation when your permission of system files in DirectAdmin is altered accidentally might create issues in doing the backup and restore or in emails or other things. In that case, DirectAdmin has scripts to fix it. But there is one limitation to this script is that it can not change the permission of user-uploaded files in public_html or private_html. This is not a limitation actually because various scripts set these altered permissions to better execution of the script. So this script is made not to touch user uploaded file or folder permission. Please see the below steps to reset permissions in DirectAdmin.

Step 1:- Login as root

Step 2:- For resetting all accounts and everything on DirectAdmin use the following command:

cd /usr/local/directadmin/scripts
./set_permissions.sh all

For resetting permissions and ownership of a single domain, the issue follows from the command line:

./set_permissions.sh domaindir domain.com

Please replace domain.com with the actual domain. To Reset users’ home directory permissions use below:

./set_permissions.sh user_homes

To reset DirectAdmin system files and folder only use the following:

./set_permissions.sh da_files

For resetting MySQL permissions use below:

./set_permissions.sh mysql

To reset email permissions use below:

./set_permissions.sh email

To reset etc configuration files use below:

./set_permissions.sh etc_configs

To reset logs file permissions use below:

./set_permissions.sh logs

To reset the home dir of the specific user in DirectAdmin use below:

./set_permissions.sh set_user_home <user>

Please replace <user> with actual directadmin user.