Hong Manh's BlogHong Manh's Blog Sharing Technology Knowledge

How to reset and retrieve directadmin admin password using shell?

To reset and retrieve the DirectAdmin admin password using shell, you can follow these steps:

Reset the direct admin password:

1.Connect to your server via SSH using a terminal or command prompt.

2. Change to the DirectAdmin directory by running the following command:

cd /usr/local/directadmin/scripts

3. Generate a new password by executing the command:

./directadmin p

4. The system will generate a new password for the admin user. Make note of this password.

5.To update the admin password, run the command:

./directadmin set adminpassword <new-password>

Replace with the password generated in the previous step.

6.Restart DirectAdmin to apply the changes:

service directadmin restart

Once these steps are completed, you will have successfully reset and retrieved the DirectAdmin admin password using the shell. Make sure to securely store the new password for future reference.

Retrieve directadmin password

  1. Login to server via SSH.
  2. There is a file ‘/usr/local/directadmin/scripts/setup.txt‘ which containing the control panels details.
  3. Execute the following command to get adminpass:

# cat /usr/local/directadmin/scripts/setup.txt | grep adminpass

That’s it!

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments

Press ESC to close

Would love your thoughts, please comment.x