Resetting permissions in directadmin

Resetting ownership and permission of directAdmin created system files

Hi there might be a situation when your permission of system files in DirectAdmin is altered accidentally might create issues in doing backup and restore or in mails or others 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 limitation actually because various scripts set this altered permissions to better execution of the script.So this script is made not to touch user uploaded file or folders permission.Please see below steps to reset permissions in directadmin.

Step 1:- Login as root

Step 2:- For resetting all accounts and every thing on DirectAdmin use following command

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

For resetting permissions and ownership of single domain issue follow from command line.

./set_permissions.sh domaindir domain.com

Please replace domain.com with actual domain.

To Reset users’s home directory permissions use below

  ./set_permissions.sh user_homes

To reset DirectAdmin system files and folder only use 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 home dir of specific user in DirectAdmin use below

  ./set_permissions.sh set_user_home <user>

Please replace <user> with actual directadmin user

Note:- Recently some one was having issue creating a backup in direcadmin he was getting following error message which encourage 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 donot forget to replace domain.com with actual domain on DA

./set_permissions.sh domaindir domain.com
Was this article helpful?
YesNo

Leave a Reply

Your email address will not be published. Required fields are marked *