Reset the root password
Open the server page and choose Reset root password: a new random password is set for root and shown to you once. It gets you in over SSH only if your sshd allows password logins for root; if password logins are switched off, use your SSH key, another sudo user, or ask support. Afterwards change it to one you store safely with <code>passwd</code>.
Recovery and troubleshooting guide, updated 2026-12-03
What does the reset button actually do?
The reset generates a fresh random password and writes it into the root account of the operating system on your disk. The console displays it once on the server page. Copy it into your password manager straight away, because it cannot be shown again; if you miss it, simply run the reset again and a new one replaces it.
The server must be running or shut down for the reset to work, not in the middle of a rebuild. The reset changes only the root password. Your files, other users, SSH keys and services stay as they were, which makes it the gentlest recovery tool the console has.
When does a new root password get you back in?
Whether the password helps depends on your SSH daemon settings, not on the console. Check these two lines in /etc/ssh/sshd_config and every file in /etc/ssh/sshd_config.d/:
PasswordAuthentication: must beyesfor any password login over SSH.PermitRootLogin: must beyesfor root to log in with a password. The valueprohibit-password(the default on current OpenSSH) allows root with a key only, andnoblocks root completely.
Fresh images created without an SSH key allow root password login so you can get in at all. If you followed the SSH hardening guide and switched passwords off, a new root password does not open SSH for you. In that case log in with your key or a second sudo user, or open a support ticket. The password is still useful later for su - from another account.
How do you log in with the new password?
Tell your client to prefer the password so it does not burn through your key attempts first:
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no root@203.0.113.10Paste the password when asked; nothing is echoed while you type. If you see Permission denied (publickey) without ever being asked for a password, the server does not offer password logins at all, which matches the case described above. If the client asks and then refuses the correct password, check that PermitRootLogin is not set to prohibit-password.
On first login after a reset, look around before changing anything: last -n 10 shows recent logins and journalctl -u ssh -n 50 (on Rocky and Alma the unit is sshd) shows what happened on the SSH side.
How do you set your own password afterwards?
The random password is long, which is good, but it has passed through a web page and your clipboard. Replace it with one generated in your password manager:
passwd
New password:
Retype new password:
passwd: password updated successfullyTo change another user, name it: passwd deploy. For a non-interactive change in a script, chpasswd reads user:password lines from standard input, but avoid putting passwords on the command line, because they end up in shell history and the process list.
How do you control password expiry with chage?
chage shows and sets the aging rules stored in /etc/shadow:
chage -l root
Last password change : Dec 03, 2026
Password expires : never
Password inactive : never
Account expires : neverOn a server where everyone logs in with keys, expiry adds little and can lock a service account out at a bad moment, so most admins leave it at never. If your policy needs it, chage -M 180 deploy forces a new password every 180 days, and chage -d 0 deploy forces a change at the next login, which is handy when you hand a temporary password to a colleague.
To lock an account without deleting it, use passwd -l username. This only blocks password logins; keys in authorized_keys still work, so also remove or comment out those lines if the person should lose access.
How do you keep the password out of sight?
The console page shows the password once. Do not leave it open on a shared screen, and do not paste it into tickets or chat. Inside the server, a few habits keep passwords away from logs:
- Type passwords only at prompts that hide input, never as arguments.
- Prefix a command with a space to keep it out of bash history when
HISTCONTROL=ignorespaceis set (the default on Ubuntu and Debian). - Clear a line you already leaked with
history -dfollowed by its number, thenhistory -w.
Remember that your account key for the CheapVPS console is the real master key: anyone holding it can reset the root password. Store it as carefully as the password itself.
Should you allow root password login permanently?
Use password login only as a short bridge. Once you are in, add your public key to /root/.ssh/authorized_keys, test a key login from a second terminal, then return sshd to keys only:
printf "PasswordAuthentication no\nPermitRootLogin prohibit-password\n" > /etc/ssh/sshd_config.d/10-keys-only.conf
sshd -t && systemctl reload sshOn Rocky Linux and AlmaLinux the service is called sshd. Keep the existing session open until a fresh key login works. Leaving passwords on invites constant guessing from bots, which you will see as thousands of lines in lastb.
What if the reset does not seem to work?
First confirm you copied the whole password without a trailing space. Then check whether the server is reachable at all with nc -vz 203.0.113.10 22. If the port is closed or the server does not answer, the password is not the problem; follow the boot triage guide.
If SSH answers but refuses the password even though password login is allowed, tools like fail2ban may have banned your IP after earlier failures. Try from another network, or log in with a key and run fail2ban-client status sshd to see and unban addresses. A server that you changed heavily, for example with a custom PAM setup, may also reject a reset password; a support ticket is then the right next step.
Questions about this guide
Is the new password shown again later?
No, it appears once on the server page. Run the reset again if you lose it; the previous one stops working.
Does the reset touch my files or SSH keys?
No. Only the root password changes. Files, users, keys in authorized_keys and services stay as they are.
Why does SSH not even ask for a password?
Password logins are switched off in sshd (PasswordAuthentication no). Use your key or another sudo user, or open a support ticket.
Can I reset the password of a normal user from the console?
The console resets root only. Log in as root or with sudo and run passwd username for any other account.
Does a new password undo a compromise?
No. An attacker may have added keys, users or cron jobs. Follow the malware check guide and plan a rebuild if anything looks wrong.
Can I reset while the server is off?
Yes, a shut down server can be reset, and the new password applies when you power it on.