Knowledge Base

Everything you need to know about HostZealot

How to change the root password on a Linux server?

You can change the root password directly from the command line on your Linux server.

Note:
This guide applies to both HostZealot VPS and dedicated servers running Linux.

Before You Start

  • You need the current root password and the server's IP address.
  • HostZealot Linux servers use SSH port 56777 instead of the standard port 22, so you must specify it when connecting.
  • You need an SSH client: Terminal on macOS/Linux, PowerShell or Windows Terminal on Windows, or PuTTY.

Step 1. Connect to Your Server via SSH as Root

Run the following command, replacing <SERVER_IP> with your server's IP address:

ssh root@<SERVER_IP> -p 56777

Enter the current root password when prompted. Nothing is displayed while you type the password. This is normal.

If the password is incorrect, you will see:

root@<SERVER_IP>'s password:
Permission denied, please try again.

Enter the password again. After a successful login, you will see something similar to:

Last failed login: Wed Sep 23 17:58:06 UTC 2026 from 193.42.36.2 on ssh:notty
There were 5 failed login attempts since the last successful login.
Last login: Wed Sep 23 10:08:07 2026 from 193.42.36.2
[root@srv151362 ~]#

The failed login attempts message is informational and may include your own unsuccessful login attempts. If you see attempts you do not recognize, make sure to use a strong, unique password.

Step 2. Change the Root Password

Run:

passwd

Enter the new root password and then enter it again to confirm. The two entries must match. As with the SSH login, no characters are displayed while you type the password.

A successful password change looks like this:

[root@srv151362 ~]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@srv151362 ~]#

The message all authentication tokens updated successfully confirms that the new root password is active.

Password Recommendations

  • Use at least 12 characters with a combination of uppercase and lowercase letters, numbers, and special characters.
  • Do not reuse passwords from other services.
  • Store the password in a password manager.
  • If you see Sorry, passwords do not match, enter the new password again carefully.
  • If you see a BAD PASSWORD warning, the password may not meet the server's password policy. Use a stronger password and try again.

If You Have Lost the Root Password

The steps above require the current root password. If you have lost it and cannot access the server via SSH, contact HostZealot Support for assistance with restoring access.

Share
cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.