If you have lost access to the DirectAdmin control panel, you can regain access via SSH. Because the DirectAdmin admin account is linked to a Linux system user, managing the password is straightforward.
Prerequisite:
You must have root access via SSH to perform these steps.
You must have root access via SSH to perform these steps.
Scenario 1: Retrieve the original password
If you have never manually changed the admin password since the installation, you can simply read it from the setup logs.
- Log in via SSH as
root. - Run the following command to view the setup details:
cat /usr/local/directadmin/scripts/setup.txt
Look for the line starting with adminpass=. This is your original password.
Scenario 2: Force a Password Reset
If you have changed the password previously and don't remember it, you can overwrite it using the standard Linux password command.
- Log in via SSH as
root. - Run the password change command for the user 'admin':
passwd admin
You will be prompted to enter a new password twice.
(Note: You will not see the characters while typing due to Linux security masking).
Success!
Once you see the message
Once you see the message
passwd: all authentication tokens updated successfully, you can log in to DirectAdmin immediately with the new password.