2 mins read

How to change the account password in DirectAdmin and SSH

In DirectAdmin control panel you can change the present configured password at anytime. In this article, we will cover the step-by-step guide on How to change the account password in DirectAdmin?

Change Password Using GUI

1. First, to login into DirectAdmin control panel visit,

https://your-domain.com:2087 or https://IP-address:2087or https://server-hostname:2087.

2. Top right-click → Click on Username → Click on Password.

3. Enter the required information,

Current DirectAdmin Password: Enter the current password of DirectAdmin control panel.

Enter new password: Enter the complex and hard to guess password.

4. Finally, click on Save.

Access Your Server via SSH

  • Open your terminal or SSH client.
reset directadmin password from SSH
  • Connect to your server using the root user. For example:
   ssh root@your_server_ip

Step 2: Retrieve the Current Admin Password

  1. Once you are logged in, you can retrieve the current DirectAdmin admin password by running the following command:
   cat /usr/local/directadmin/scripts/setup.txt | grep adminpass
  1. This command will display a line similar to:
   adminpass=your_current_password

Step 3: Reset directadmin password from SSH

  1. To reset the admin password, use the following command:
   passwd admin
  1. You will be prompted to enter the new password and confirm it.

Step 4: Update DirectAdmin Configuration

  • After resetting the admin password, you need to update the DirectAdmin configuration with the new password. Run the following command:
   echo "adminpass=new_password" >> /usr/local/directadmin/scripts/setup.txt

Step 5: Restart DirectAdmin

  1. Finally, restart DirectAdmin to ensure the changes take effect:
   service directadmin restart

Alternative Method: Using DirectAdmin Commands

  1. You can also use DirectAdmin’s internal command to reset the admin password. Run the following:
   /usr/local/directadmin/directadmin set admin_pass new_password
  1. Restart DirectAdmin:
   service directadmin restart

Make sure to replace new_password with the actual password you want to set.