How to change Admin Username

bumfank

Verified User
Joined
Oct 23, 2008
Messages
9
hi,

I want to move my server to another server. But second server have admin account. How can I change my admin account from first server for transfer that account to another server with only user rights. For example:
Server 1 User ADMIN transfer to Server 2 User SOMEUSER
 
Hello,

1) Create the backup on server 1.
Admin Level -> Admin Backup Transfer

it will create a file that looks like this:
admin.root.admin.tar.gz

2) copy this file to box 2, except rename it to:
user.admin.someuser.tar.gz

3) Restore normally.. and that should restore it to a new user called "someuser" as a user.

4) If the account doesn't end up being a User account (and is Admin), edit:
/usr/local/directadmin/data/users/someuser/user.conf

and change:
usertype=admin

to be:
usertype=user

John
 
Hello,

1) Create the backup on server 1.
Admin Level -> Admin Backup Transfer

it will create a file that looks like this:
admin.root.admin.tar.gz

2) copy this file to box 2, except rename it to:
user.admin.someuser.tar.gz

3) Restore normally.. and that should restore it to a new user called "someuser" as a user.

4) If the account doesn't end up being a User account (and is Admin), edit:
/usr/local/directadmin/data/users/someuser/user.conf

and change:
usertype=admin

to be:
usertype=user

John

Sorry for disturbing an old thread. In the setup.sh script, I can see the admin username mention in this variables here:

ADMIN_USER=admin
DB_USER=da_admin
#ADMIN_PASS=`perl -le'print map+(A..Z,a..z,0..9)[rand 62],0..9'`;
ADMIN_PASS=`random_pass`
#RAND_LEN=`perl -le'print 16+int(rand(9))'`
#DB_ROOT_PASS=`perl -le"print map+(A..Z,a..z,0..9)[rand 62],0..$RAND_LEN"`;
DB_ROOT_PASS=`random_pass`

If I change this, would I break anything during installation? Is it possible to change this during installation?
 
I I think you could set up a test box. Download the latest setup.sh. Change admin to “whatever”
Then run script

You also could use a read question to ask you to type in and use that read variable to post the name.

in general we have been told not to change the name after the fact. I assume anything is possible. Anything is just not supported I assume.
 
This post has 3k views+ , so i guess people keep coming into this post to find the latest solution. So, the latest way to change directadmin username (admin) into other is using the latest script provided by Directadmin in here:

Bash:
/usr/local/directadmin/scripts/change_username.sh oldusername newusername

and to change the admin password, you do it normally in the linux terminal or in bash way:

Bash:
#!/bin/bash
ADMIN_USERNAME="admin"
ADMIN_PASSWORD="mynewpassword"
#For Debian:
echo "${ADMIN_USERNAME}:${ADMIN_USERPASS}" | chpasswd
#For CentOS:
# echo "${ADMIN_USERPASS}" | passwd --stdin "${ADMIN_USERNAME}"

Alternatively, you can also change admin password via GUI in Directadmin page
 
Back
Top