Unable to create domain after DirectAdmin update – permission denied

mariaus

Verified User
Joined
Sep 8, 2021
Messages
10
Hello,


After the latest DirectAdmin update, I started getting an error when trying to create a new domain:

1758624779156.png


It looks like DirectAdmin doesn’t have permission to create the required directories or files.
Before the update everything was working fine — this issue only appeared after the upgrade.

Has anyone else run into this problem and found a solution?

Thanks in advance for your help.
 
Hello,

Wrong ownership can occur if one uploads files over root's SSH session. Use the script:

Bash:
[root@dev ~]# /usr/local/directadmin/scripts/set_permissions.sh
***********************************************
Tue Sep 23 02:10:17 PM UTC 2025 : /usr/local/directadmin/scripts/set_permissions.sh

DirectAdmin File Permission/Ownership script

Usage:
  /usr/local/directadmin/scripts/set_permissions.sh all
  /usr/local/directadmin/scripts/set_permissions.sh all_with_domaindirs

  /usr/local/directadmin/scripts/set_permissions.sh da_files
  /usr/local/directadmin/scripts/set_permissions.sh domaindirs
  /usr/local/directadmin/scripts/set_permissions.sh user_homes
  /usr/local/directadmin/scripts/set_permissions.sh mysql
  /usr/local/directadmin/scripts/set_permissions.sh email
  /usr/local/directadmin/scripts/set_permissions.sh logs
  /usr/local/directadmin/scripts/set_permissions.sh etc_configs

internal:
  /usr/local/directadmin/scripts/set_permissions.sh maildir <user> <path/Maildir>
  /usr/local/directadmin/scripts/set_permissions.sh set_user_home <user>
  /usr/local/directadmin/scripts/set_permissions.sh domaindir <domainname> [<user>]; user could be skipped

[root@dev ~]#


to fix it:

Bash:
/usr/local/directadmin/scripts/set_permissions.sh all_with_domaindirs
 
I tried this command, but the same problem remains.

Code:
/usr/local/directadmin/scripts/set_permissions.sh all_with_domaindirs
 
May you print an output from the following commands here:

Bash:
ls -dla /
ls -dla /home/
ls -dla /home/admin/
ls -dla /home/admin/domains/
ls -dla /home/admin/domains/*/
ls -dla /home/admin/domains/*/public_html/
 
Code:
[root@banzai ~]# ls -dla /
ls -dla /home/
ls -dla /home/admin/
ls -dla /home/admin/domains/
ls -dla /home/admin/domains/*/
ls -dla /home/admin/domains/*/public_html/
dr-xr-xr-x. 18 root root 255 Feb 12  2025 /
drwx--x--x. 6 root root 63 Mar 12  2025 /home/
drwx--x--x 14 admin admin 4096 Sep 24 00:10 /home/admin/
drwx--x--x 12 admin admin 4096 Sep 23 18:10 /home/admin/domains/
drwxr-xr-x 2 admin admin  24 Feb 13  2025 /home/admin/domains/default/
drwx--x--x 5 admin admin  80 Sep 23 13:37 /home/admin/domains/kaunas.lt/
drwx--x--x 5 admin admin  80 Sep 23 13:44 /home/admin/domains/laikai.lt/
drwx--x--x 5 admin admin  80 Sep 23 13:44 /home/admin/domains/laikoratas.lt/
drwxr-xr-x 2 admin admin   6 Feb 13  2025 /home/admin/domains/sharedip/
drwxr-xr-x 2 admin admin   6 Feb 13  2025 /home/admin/domains/suspended/
drwxr-x--- 2 root  root     6 Sep 23 13:37 /home/admin/domains/kaunas.lt/public_html/
drwxr-x--- 2 root  root     6 Sep 23 13:44 /home/admin/domains/laikai.lt/public_html/
drwxr-x--- 2 root  root     6 Sep 23 13:44 /home/admin/domains/laikoratas.lt/public_html/
 
Last edited:
But the domain’s folder is created correctly at:
/home/admin/domains/kaunas.lt/
but it cannot be opened /public_html/ — it shows an error.

1758662199145.png
 
Last edited:
Those permissions/ownership look all wrong.

Do you possibly have some scripts in "/usr/local/directadmin/scripts/custom"? Specifically a user_create_post.sh or something like that.

The set_permissions.sh script should have fixed this, unless the files/directories have been chattr to immutable.
 
But the domain’s folder is created correctly at:
/home/admin/domains/kaunas.lt/
but it cannot be opened /public_html/ — it shows an error.

can it be so that you as root uploaded the sites data before creating domains in directadmin?
 
can it be so that you as root uploaded the sites data before creating domains in directadmin?

I installed DirectAdmin about a year ago using root, but since then I’ve been managing everything through DirectAdmin with the automatically assigned username: admin. I create all domains via DirectAdmin under this admin account, not by uploading anything directly as root.
 
I just tested on my server and if I run the suggested command as root, it corrects permissions:

Bash:
/usr/local/directadmin/scripts/set_permissions.sh all_with_domaindirs

Tested:

Bash:
[root@~]# ls -lda wp7test.net
drwx--x--x 8 root root 4096 Oct  1 23:29 wp7test.net
[root@~]#
[root@~]# /usr/local/directadmin/scripts/set_permissions.sh all_with_domaindirs >/dev/null 2>&1
ls -lda wp7test.net
[root@~]# ls -lda wp7test.net
drwx--x--x 8 wp7test wp7test 4096 Oct  1 23:32 wp7test.net
[root@~]#

If it did not work in your case, then either you executed the command as a regular user, or the folders have an IMMUTABLE attribute.

In any case you might use the command chown to set the folders owned by admin and see whether or not it reports any error.

- See how to use the command: https://linux.die.net/man/1/chown
 
Back
Top