Who this guide is for
If you can still reach your server over SSH as root, but the cPanel, Plesk or DirectAdmin login screen rejects your password, this guide is for you. It covers recovery on your own server, not someone else's account. The commands assume cPanel & WHM 110 or later, Plesk Obsidian 18.x, and a current DirectAdmin release. Older releases may have slightly different paths, but the main command names are stable. On shared hosting, ask your host to reset the password; shell access is usually disabled for security. Before changing anything, take a backup or provider snapshot and keep a note of the panel you are using.
Before you start
- SSH access as root or an equivalent privileged user.
- A strong new password that you have not used elsewhere.
- A snapshot or backup of the server, if your provider offers one.
- The panel URL and port: cPanel usually uses 2083, WHM 2087, Plesk 8443, and DirectAdmin 2222. Custom ports are possible.
Do not run these commands on a machine you do not control. If you have lost SSH access as well, use your provider's console or VNC and contact support. If you are a Tarisu VPS or dedicated-server customer, the console is the first place to check; for a Tarisu web hosting account, support can reset the panel login without giving you shell access. Keep your current SSH session open until you have tested the new password.
Step 1: Confirm the panel and account
Before resetting, confirm which panel is running. On many servers, the process list and the default ports make this obvious. Check the running services:
ps aux | grep -E 'cpanel|plesk|directadmin'
If cPanel is present, list its account files:
ls /var/cpanel/users
If Plesk is present, check its version:
plesk version
If DirectAdmin is present, confirm the admin user exists:
getent passwd admin
You should see a line for the admin user, or the cPanel username you want to change. If the command returns nothing, stop and check that you are on the right server. A wrong server is a common cause of "user does not exist" errors.
Why the three panels need different commands
cPanel accounts are managed by WHM's API, WHM itself uses the server root account, Plesk keeps its admin user in its own database, and DirectAdmin maps its admin user to a Linux system user. That is why a single generic password-reset command does not work across all three. Use the command for the panel you actually run. If you are unsure, check the process list and the login URL before making changes.
Step 2: Take a backup or snapshot
Password recovery is usually quick, but a mistyped command can lock you out further. Take a provider snapshot before you begin. On a VPS or dedicated server, a snapshot is the safest option. If you cannot take a snapshot, at least record the current panel URL, port, username, and any firewall rules. Do not copy passwords into a public file or paste them into a ticket. If the server has been compromised, a snapshot also gives you a clean reference point.
Step 3: Reset a cPanel account password
cPanel account passwords can be changed from WHM's command-line API. Run the command as root and replace USERNAME and NEW_PASSWORD with your own values:
whmapi1 modifyacct user=USERNAME password='NEW_PASSWORD'
To avoid leaving the password in your shell history, use a read prompt:
read -s -p 'New cPanel password: ' PW
whmapi1 modifyacct user=USERNAME password="$PW"
unset PW
You should see a JSON response with status: 1 and a success message. Then open the cPanel login page, usually https://your-server-ip:2083, and sign in with the cPanel username and the new password. If the response shows an error, read the message before retrying. cPanel may reject passwords that do not meet its strength rules.
Reset the WHM root password
WHM itself authenticates with the server's root account. If you know the server root password but cannot reach WHM, the usual fix is to reset the Linux root password and then log in to WHM at port 2087:
passwd root
Use a password that is different from the cPanel account password. WHM uses the same root account as SSH, so changing it also changes root SSH access. Keep your current SSH session open until you have tested the new password. If you cannot log in to WHM after the reset, check that port 2087 is reachable and that no firewall is blocking your IP address.
Step 4: Reset the Plesk admin password
Plesk stores its administrator login in its own database, so the normal Linux passwd command is not the right tool. Use the Plesk command-line utility:
plesk bin admin --create-admin-login -passwd 'NEW_PASSWORD'
For a less history-prone version:
read -s -p 'New Plesk admin password: ' PW
plesk bin admin --create-admin-login -passwd "$PW"
unset PW
You should see a confirmation that the admin login was created or updated. Open https://your-server-ip:8443 and sign in as admin. If Plesk is behind a firewall, check that port 8443 is open to your IP address. Plesk may also ask for a second factor if your administrator account has one enabled.
Step 5: Reset the DirectAdmin admin password
DirectAdmin's default administrator is a system user named admin. You can reset the password with the standard Linux tools:
passwd admin
Or, without an interactive prompt:
read -s -p 'New DirectAdmin admin password: ' PW
echo "admin:$PW" | chpasswd
unset PW
You should see no output on success. Open the DirectAdmin login page, usually http://your-server-ip:2222 or HTTPS on the same port, and sign in as admin. If your DirectAdmin installation uses a non-default admin user, check the user list in the panel or with your provider before changing the password. The admin password is also the Linux password for that user on a default installation, so test SSH access as admin only if you normally use it.
What you should see
| Panel | Command | Expected result |
|---|---|---|
| cPanel account | whmapi1 modifyacct ... | JSON response with success status |
| WHM root | passwd root | Password update confirmation |
| Plesk admin | plesk bin admin --create-admin-login ... | Admin login created or updated |
| DirectAdmin admin | passwd admin or chpasswd | No error; login works on port 2222 |
If the command returns an error, do not keep retrying with the same password. Check the troubleshooting section below, and take a fresh snapshot before making further changes.
Troubleshooting common errors
whmapi1: command not found
The binary is usually in the root user's PATH, but you can call it directly:
/usr/local/cpanel/whostmgr/bin/whmapi1 modifyacct user=USERNAME password='NEW_PASSWORD'
If the user does not exist, list the cPanel accounts first:
ls /var/cpanel/users
If the password is rejected by a policy, choose a longer password with mixed characters. cPanel may enforce its own password rules. If the command returns an authentication error, confirm that you are logged in as root and that the cPanel service is running.
plesk: command not found
Call the Plesk CLI by its full path:
/usr/local/psa/bin/plesk bin admin --create-admin-login -passwd 'NEW_PASSWORD'
If the command returns an error about the admin user, check that you are on the Plesk server and not on a separate database host. Plesk's admin account is local to the panel. If Plesk is managed through a service plan, use the admin login for the correct server, not a customer login.
passwd: user admin does not exist
DirectAdmin normally creates the admin system user, but a custom setup may use a different name. Check the panel's user list or ask your provider. Do not create a new Linux user unless you know how DirectAdmin maps users to accounts. If the admin user exists but the password is still rejected, check that the DirectAdmin service is running and that port 2222 is reachable.
Command seems to hang or returns no output
Some commands wait for a password or confirmation. If a prompt appears, type the new password and press Enter. If nothing appears, press Ctrl+C and check the command syntax. For DirectAdmin, the chpasswd form expects the username and password on one line; a missing newline can make it look like the command did nothing.
Login page still rejects the password
- Check the port: cPanel 2083, WHM 2087, Plesk 8443, DirectAdmin 2222. Firewalls may block these ports.
- Check two-factor authentication. If it is enabled, resetting the password may not be enough; you may need the panel CLI or provider console to reset the second factor.
- Try a private browser window to avoid cached cookies and old sessions.
- Confirm the username. cPanel and DirectAdmin are case-sensitive in some setups; Plesk admin is usually
admin. - If you changed the WHM root password, remember that root SSH and WHM share the same credential.
No SSH access
Use the provider's console or VNC. On a Tarisu VPS or dedicated server, the console lets you log in even when SSH is unavailable. If you do not have console access, contact support with the server identifier; do not share passwords in the ticket. For shared hosting, the provider can reset the control-panel password without giving you shell access.
Security notes
Password recovery is a high-value moment for an attacker. Change the password on a trusted network, use a long unique passphrase, and store it in a password manager. Avoid putting passwords in shell history by using read -s as shown above. After recovery, review active sessions, remove unused SSH keys, and check for unfamiliar admin users.
If the server may have been compromised, a password reset alone is not enough. Take a snapshot, inspect logs, rotate API keys and database passwords, and consider rebuilding from a known-good backup. For cPanel and Plesk, review the panel's security advisor or equivalent built-in report. For DirectAdmin, review the admin user and service configuration.
Also review the panel's API tokens and service accounts. A stolen API token can reset passwords without a password change, so rotate tokens that may have been exposed. If you use a password manager, store the panel URL, username, and port together with the password. Avoid writing the password in a shared notes document.
Keep SSH root login restricted. Prefer key-based authentication, limit access by IP where possible, and use a firewall to restrict panel ports to trusted addresses. If you use Tarisu hosting, the same principles apply: use the smallest access needed, keep backups current, and ask support before changing shared server settings.
FAQ
Can I reset a cPanel password without root?
Yes, if cPanel's password-reset email works and the account's contact email is reachable. If not, you need WHM root access or help from the hosting provider. On shared hosting, the provider resets it for you.
Does resetting the Plesk admin password affect websites?
No. It changes the Plesk administrator login, not website files, databases, or FTP accounts. However, if the Plesk admin password is also used for something else, change that too.
Is the DirectAdmin admin password the same as the Linux admin password?
On a default DirectAdmin installation, yes: the admin account is a system user, so passwd admin changes the password used for DirectAdmin and for SSH as that user. Keep a root session open until you test it.
Which port should I use after recovery?
cPanel usually uses 2083, WHM 2087, Plesk 8443, and DirectAdmin 2222. Your provider may use custom ports. Check the login URL in your original configuration or ask support.
Why did the login still fail after a successful reset?
Check the URL and port, two-factor authentication, firewall rules, and whether the account was locked after repeated attempts. A private browser window can rule out stale cookies.
What if I do not have SSH access?
Use the provider's console or VNC. If that is unavailable, contact support with the server identifier and ask for a password reset. Never share the current or new password in a public ticket.