Fix or Reset Broken Permissions in DirectAdmin

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.

Note:- Recently someone was having an issue creating a backup in DirectAdmin he was getting the following error message which encourages me to write this article.

An error occurred during the backup
2020-4-15 00:09
Parent directory does not allow write, or one of the directories didn’t allow search (execution) permission

Fixed it by executing the following don't forget to replace domain.com with an actual domain on DA:

./set_permissions.sh domaindir domain.com
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to reinstall DirectAdmin in your web server?

Run the following commands to install: cd /usr/local/directadmin./directadmin i./directadmin p

How to install imagick with custombuild of DA?

Run the following command: cd /usr/local/directadmin/custombuild ./build update ./build...

The service ‘exim’ on server xxx is currently down

Rebuild your exim. cd /usr/local/directadmin/custombuild./build update./build set exim...

Change DA port to your choice where CSF installed

Here I will show you how to change the port from 2222 to 9999 in two steps. Step One:...

How to migrate cPanel account to DirectAdmin?

The cPanel conversion script currently only works for Admin Level restores. You must have to be...