reset directadmin password from SSH

How to reset directadmin password from SSH ?

reset directadmin password from SSH

To reset DirectAdmin password from SSH, you will need to access your server as a root user.

Step 1: 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.