How to Change Your VPS Root Password

Whether you've forgotten your root password, want to rotate it as a security practice, or received a default password you need to change, this guide covers the process safely.

Changing Your Root Password (If Currently Logged In)

sudo passwd root

Or, if logged in directly as root:

passwd

Follow the prompt to enter and confirm a new, strong password.

Choosing a Strong Password

Use a genuinely long, random password — ideally generated by a password manager rather than something memorable/guessable, especially since root access grants complete control over the server.

If You've Forgotten Your Root Password Entirely

Access your server via your provider's web console (see How to Access Your VPS Console When SSH Isn't Working) using your Client Area login, which doesn't require the server's own root password — then reset the root password from within that session.

Resetting Root Password via Your Provider's Panel

Many providers offer a "reset root password" option directly in the Client Area's server management page, generating a new password without needing existing server access at all — check for this option before assuming you're fully locked out.

Should You Even Use Password Authentication for Root?

Best practice is disabling direct root SSH login entirely and using sudo instead — see SSH Hardening: Change the Port, Disable Root Login & Use SSH Keys. A root password is still relevant for console access even when SSH login is disabled.

Rotating Your Root Password Periodically

Consider periodically rotating your root password as a general security hygiene practice, particularly if you suspect it might have been exposed (accidentally shared, visible in shared documentation, etc.).

Storing Your Root Password Securely

Never store the root password in plain text files, unencrypted notes, or shared documents — use a proper password manager, especially given the complete access this credential provides.

Changing Passwords for Other Users

sudo passwd username

The same command pattern works for changing any user's password, substituting root with the specific username.

Verifying the Change Took Effect

Log out and attempt to log back in (via console, if SSH password auth is disabled) with the new password to confirm it was successfully changed before closing your current session.

Common Errors

"passwd: Authentication token manipulation error" — can indicate a full disk (check with df -h) or a filesystem issue preventing the password file from being written; address the underlying disk/filesystem issue first.

Continue Reading

Browse more articles in Getting Started / VPS Basics.

  • change root password, reset vps password, forgot root password, vps password recovery
  • 0 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

How to Connect to Your VPS via SSH (Windows, macOS & Linux)

SSH (Secure Shell) is the standard way to remotely access and manage a Linux VPS. This guide...

How to Create a New User with Sudo Access on a Linux VPS

Using the root account for everyday administration is risky — a single mistyped command can...

How to Check VPS Resource Usage (CPU, RAM & Disk)

Monitoring your VPS's resource usage helps you catch performance problems before they cause...

How to Reboot a Linux VPS Safely

Rebooting is sometimes required — after a kernel update, to apply certain configuration...

VPS Terminology: A Beginner's Glossary

New to VPS hosting? This glossary explains the most common terms you'll encounter while setting...