Am new to DirectAdmin Control panel

Questlot

Verified User
Joined
Nov 8, 2021
Messages
5
I have used several host control panel, but it seems direct admin is more friendly and use to use.
Please how can i change the default username of my DirectAdmin?
 
For system reasons, it's better you don't. If you're not on a personal license, and you don't want to use the main admin account, it's better to create a new one with the name you want and set a very long an difficult password on the original one.

If you still want it removed, check this thread, a bit old but can still apply.

There was a discussion recently about this, but I can't find it that quickly anymore.
 
I don't have a personal license but for a lifetime license (or can be applied with license that supports more than 1 user), I always use this script to change the default admin account (I have been doing this for a long time and have not found any issues):

/usr/local/directadmin/scripts/change_username.sh "default_admin_username" "new_admin_username"

Most of the DA scripts just rely on any 'admin' role in the Directadmin system to work properly. This means you can have whatever username of the admin role you want but you must have at least 1 admin role type that must appear when you do this command:

Code:
/usr/local/directadmin/directadmin a

The above command will just take any top admin account that must exist in the system (probably inside /usr/local/directadmin/data/admin/admin.list). So, the username can be anything for the DA to work properly:


Note: DA also allows you to delete the default admin account (created by root) using the new admin account. So, this proves that the admin account is very portable in directadmin system. You can see for the test purpose in the screenshot below I can delete the default admin and I have no admin account with 'root' creator where I used to believe that this account must exist for the system to work properly.

1636440408392.png


To change the password for admin, you need to use API or change through GUI. If you change via terminal you might have an issue with backup like this:

 
Last edited:
/usr/local/directadmin/scripts/change_username.sh "default_admin_username" "new_admin_username"
That's indeed a good script to use.
But I thought I remember a script of not too long ago where @scriptkitty mentioned some other thing(s) wise to change if default admin is removed.
Maybe she can repeat that again. I could be mistaken.
 
Maybe she can repeat that again. I could be mistaken.

I just found that she mentioned this here https://forum.directadmin.com/threads/change-default-admin-username.64658/post-336443

She answered the same question as what OP asked.

and she mentioned some plugins (probably old ones) may use the /home/admin/ path and cause bugs. I haven't found any da official admin scripts inside the folder /usr/local/directadmin/scripts/ that use this path. So, this should be fine.

Also, the old scripts (probably 3rd party) or plugins that use /home/admin should be rewritten to use the admin path based on the newest command "/usr/local/directadmin/directadmin a" for portability. I think this is the reason why this feature is invented starting version 1.61.4+ to "unify" this admin location.
 
Last edited:
Back
Top