How to Retrieve and Reset a DirectAdmin Password from SSH?

Managing access to your server’s control panel is critical, especially when working with DirectAdmin. There are situations where you may forget the admin password or lose access details after installation. In such cases, SSH access allows you to quickly retrieve or reset the DirectAdmin admin password without needing to reinstall the control panel. This guide walks you through both methods safely and efficiently.

Today, we will guide you on how to retrieve and reset the DirectAdmin password from SSH.


Steps to Retrieve DirectAdmin Password

Step 1: Login to VPS or dedicated server as root user through SSH.

Step 2: Execute the following command to get the admin pass.

# cat /var/log/directadmin/install.log

OR

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


Important:

The above steps will be useful if you have just installed the DirectAdmin control panel on your server and you have closed the window without saving the login details in your local system. Once you change the password through the DirectAdmin control panel or SSH, you can't log in to it with the details mentioned in this file.


Steps to Reset the DirectAdmin Password
Step 1: Log in to your Linux VPS or dedicated server with root user through SSH.
Step 2: Execute the following command in the terminal to reset the password of the admin user.

# passwd admin

It will ask you to enter a new password.


Once it is successfully changed, you will get a message on the screen: "all authentication tokens updated successfully". It means that the password is successfully updated. That's all.


Conclusion

Retrieving or resetting your DirectAdmin admin password via SSH is a straightforward process that can save time and prevent unnecessary downtime. While retrieving the password is only useful immediately after installation, resetting it ensures you regain access at any time. Always store your credentials securely after updating them to avoid repeated recovery steps.

 

Was this answer helpful? 1 Users Found This Useful (2 Votes)