New Customers: 50% OFF Your First Month on All VPS Servers & Web Hosting Plans!

Resetting the root password on your VPS

Learn how to reset your VPS root password using Hostworld's Virtualizor panel, the HTML5 VNC console, or recovery mode if you cannot log in. Instructions cover OpenVZ, KVM and Xen platforms, plus OS-specific recovery steps for AlmaLinux 9 and Ubuntu 24.04.

Rhys CallowayLinux VPS, servers, security and the command line 8 min read Updated 23 Sep 2026 AlmaLinux 9, Ubuntu 24.04

You can reset the root password in Hostworld’s Virtualizor panel or from the operating system. In Virtualizor, use Change Root Password, then reboot if your VPS is KVM or Xen. If you cannot log in, use the browser VNC console and the OS recovery methods for AlmaLinux 9 or Ubuntu 24.04.

Before you start

  • You manage a Hostworld VPS in Virtualizor from the Hostworld client area at portal.hostworld.uk. That is where you will find the Change Root Password tool, the HTML5 VNC console, Rescue Mode and ISO mounting.
  • Virtualizor’s Change Root Password applies immediately on OpenVZ. On KVM and Xen it takes effect after you reboot the VPS.
  • Do not use Re‑Install OS in Virtualizor to fix access. It rebuilds the VPS and erases all data.
  • On Ubuntu, the root account is locked by default. You can set a root password if you want to, or keep using sudo with your user account.
  • If SSH password or root logins are disabled in sshd_config or by cloud‑init, you will not be able to use the new password over SSH until you adjust those settings. Keep the Virtualizor VNC console open while you test to avoid locking yourself out.
  • Full‑disk encryption is separate from Linux account passwords. If your disk is encrypted, you still need the disk passphrase or recovery key at boot.
  • If you are unsure or get stuck, open a support ticket. We can see your VPS details and advise safely.

Step 1: Change the password in Virtualizor

Use Virtualizor’s built‑in password tool first. It does not touch your data or OS configuration.

  1. Log in to the Hostworld client area at portal.hostworld.uk and open the Virtualizor page for your VPS.
  2. Find the Change Root Password function and enter a new strong password.
  3. Apply the change. For KVM and Xen VPSs, reboot the VPS for it to take effect. For OpenVZ, the new password applies immediately.

If the VPS does not accept the new password over SSH, use the VNC console in Virtualizor to test local logins. SSH password logins may be disabled even when the password is correct. See Step 6 for SSH settings.

Step 2: Reboot and test using the HTML5 VNC console

Use the console when SSH is not available. It connects you to the screen of your VPS.

  1. From the Virtualizor VPS page, reboot the server if required and launch the VNC or HTML5 console.
  2. Log in at the Linux login prompt with the root username and your new password. If this works, but SSH still refuses the password, focus on Step 6.

If you cannot get to a login prompt because the system fails to boot or you need to reset inside the OS, use the recovery workflows below for AlmaLinux 9 or Ubuntu 24.04.

Step 3: Reset the root password on AlmaLinux 9 using GRUB rd.break

This method edits the boot process to get a root shell before the system starts. You will use the Virtualizor VNC console for keyboard access.

  1. Reboot the VPS and open the Virtualizor VNC console.
  2. At the GRUB menu, select the default kernel, then interrupt the boot to edit it. In GRUB you can press e to edit the entry. Follow the on‑screen help to boot the edited entry.
  3. Find the line that starts with linux. Add a space and rd.break at the end of that line. This tells the initramfs to break into an early shell so you can make changes.
  4. Boot the edited entry to reach a root shell in the initramfs environment.

Now remount the system root read‑write, change the password, and schedule SELinux relabelling. The following commands run in the early shell.

AlmaLinux 9

Remount the installed system so you can write changes.

# Remount the system root writable under /sysroot
mount -o remount,rw /sysroot

Enter a chroot so your commands act on the installed system, not the initramfs.

# Change root into the installed system
chroot /sysroot

Set a new root password for the installed system.

# Set the new root password and follow the prompts
passwd

Trigger a full SELinux relabel on the next boot. This step matters. Skipping it can block logins.

# Ensure SELinux relabels files on reboot
touch /.autorelabel

Leave the chroot and the emergency shell to reboot. The relabel may take several minutes. Let it finish.

# Exit the chroot, then exit again to reboot
exit
exit

After the system reboots and completes SELinux relabelling, test the new root password in the VNC console. If SSH rejects it, check Step 6.

Step 4: Reset the root password on Ubuntu 24.04 using Recovery Mode

This method uses Ubuntu’s built‑in recovery mode. The root filesystem starts read‑only, so you must remount it read‑write before changing passwords.

  1. Reboot the VPS and open the Virtualizor VNC console.
  2. At the GRUB menu, choose Advanced options for Ubuntu, then select a recovery mode entry. When the recovery menu appears, choose the root shell option.

Ubuntu 24.04

Remount the root filesystem read‑write so passwd can update the system.

# Remount / read‑write
mount -o remount,rw /

Set a new root password. Ubuntu locks root by default, so this will enable it.

# Set the root password and follow the prompts
passwd root

Alternatively, if you prefer to keep root locked and manage via sudo, set your user’s password instead. Replace myuser with your actual username.

# Change the password for a non‑root administrator account
passwd myuser

Type exit to return to the recovery menu, then choose resume normal boot or reboot the VPS from Virtualizor.

If you see “Authentication token manipulation error”, you did not remount the filesystem read‑write. Run the remount command above and try again.

Step 5: If the OS will not boot, use Virtualizor Rescue Mode or a custom ISO

If GRUB recovery is not available or the system is too damaged to boot, Virtualizor provides two routes that do not reinstall the OS.

Virtualizor Rescue Mode

  • Enable Rescue Mode for your VPS in Virtualizor and set a temporary rescue password. The first activation can take 3 to 5 minutes.
  • The VPS will boot into a predefined Debian‑based rescue environment. From there you can mount your original disks and chroot into the installed system to run passwd, then reboot back to normal.

If you are not sure which device to mount or how to chroot cleanly, open a support ticket. We will help you choose the right volumes and avoid data loss.

Boot a custom ISO

  • Attach a live ISO in Virtualizor and set the VPS to boot from CD or ISO first, then hard disk.
  • Use the live environment’s terminal to mount your system disk and chroot, then run passwd for root or your user. Remove the ISO and boot back to the disk when finished.

ISO recovery is useful if GRUB is broken and Rescue Mode is not suitable. Do not run any installer. You are using the ISO to repair the existing installation.

Step 6: Check SSH settings and cloud‑init if passwords still do not work over SSH

You might have changed the password correctly but still be blocked by configuration. Two common causes are sshd_config settings and cloud‑init policy.

Review SSH settings

PermitRootLogin governs whether the root account can log in via SSH. PasswordAuthentication and KbdInteractiveAuthentication control whether password prompts are accepted. Snippet files under /etc/ssh/sshd_config.d can override the main config. Use the VNC console to avoid being locked out while you test.

Check the effective settings. This reads both the main file and any snippets.

AlmaLinux 9

# Show relevant SSH options from the main file and any snippets
grep -E '^(PermitRootLogin|PasswordAuthentication|KbdInteractiveAuthentication)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf 2>/dev/null || true

Ubuntu 24.04

# Show relevant SSH options from the main file and any snippets
grep -E '^(PermitRootLogin|PasswordAuthentication|KbdInteractiveAuthentication)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf 2>/dev/null || true

Edit the files to allow the logins you intend. For example, to allow root to log in with a password for testing, set:

  • PermitRootLogin yes
  • PasswordAuthentication yes

Restart the SSH service or reboot the VPS from Virtualizor to apply changes. Keep the VNC console open while you test a new SSH session. Once confirmed, consider hardening again if you changed settings for testing.

Account management on Ubuntu

Ubuntu expects administrators to use sudo. You can keep root locked and log in as your user, then run administrative commands with sudo. To set or change the root password anyway, you can use sudo from your user account when you already have access:

# Ubuntu: set or change the root password from a sudo-capable user
sudo passwd root

Consider cloud‑init

Cloud‑init can change SSH authentication and user passwords at boot. If a template set ssh_pwauth: false, password authentication over SSH will remain disabled even if sshd_config looks correct. The chpasswd module can set or expire passwords too. Review your cloud‑init configuration and adjust if needed, then restart SSH or reboot.

AlmaLinux 9

# Show instances of ssh_pwauth in cloud-init configs
grep -R "ssh_pwauth" /etc/cloud 2>/dev/null || true

Ubuntu 24.04

# Show instances of ssh_pwauth in cloud-init configs
grep -R "ssh_pwauth" /etc/cloud 2>/dev/null || true

If cloud‑init is enforcing ssh_pwauth: false, plan your change and test from the VNC console so you do not lose access. If you are unsure, open a support ticket and we will check your template’s policy.

Step 7: Avoid destructive actions

Do not use Re‑Install OS in Virtualizor to reset a password. It wipes the VPS and deploys a fresh image. Only pick it when you intend to start again and have backups of anything important.

What next

  • Explore more VPS administration topics in our VPS guides. They cover consoles, networking and recovery.
  • If you are evaluating where to host, see our UK location option at Linux VPS. We run our own data centre in Maidenhead, Berkshire.
  • Need help at any point, or not sure which recovery route to use on your plan, open a support ticket. Tickets link to your account and VPS so we can act quickly.

Common questions

Will changing the root password in Virtualizor erase my data?

No. Virtualizor’s Change Root Password updates credentials without touching your files. Re‑Install OS is the destructive action that erases the VPS and deploys a fresh image. Do not use that to fix access.

I changed the password but SSH still refuses it. Why?

Two common reasons. Password logins or root SSH logins are disabled in sshd_config or snippet files under /etc/ssh/sshd_config.d, or cloud‑init is enforcing ssh_pwauth: false. Test in the Virtualizor VNC console first so you know the password works locally, then review SSH and cloud‑init settings. Restart SSH or reboot to apply changes.

How long does Virtualizor Rescue Mode take to activate?

The first activation typically takes 3 to 5 minutes. You will set a temporary rescue password when enabling it. Once booted into the rescue environment, you can mount your original disks, chroot and reset passwords.

On AlmaLinux 9, why do I need to relabel SELinux after resetting the password?

Because the password database and security contexts need to match. If you skip touch /.autorelabel during the rd.break workflow, SELinux can block logins on the next boot. Always schedule the relabel and let it finish.

What if my disk is encrypted?

Linux account passwords do not bypass disk encryption. You still need the LUKS passphrase or recovery key at boot to decrypt the disk. Without it there is no supported way to access the data. If you are unsure whether your VPS uses encryption, open a support ticket and we will check.