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
./ all

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

./ domaindir

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

./ user_homes

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

./ da_files

For resetting MySQL permissions use below:

./ mysql

To reset email permissions use below:

./ email

To reset etc configuration files use below:

./ etc_configs

To reset logs file permissions use below:

./ logs

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

./ set_user_home <user>

Please replace <user> with actual directadmin user.