Virtualizor

Change the root password and hostname of a VPS in Virtualizor

Reset a forgotten VPS root password and change the server hostname from the Virtualizor panel, or do it inside Linux, and avoid common problems after the change.

BeginnerVirtualizor VPS2 min read

Forgot your VPS root password, or need a proper hostname before installing a control panel or mail server? Virtualizor can change both from the panel, without SSH access. This guide covers the panel method and the equivalent Linux commands.

Before you start

  • Access to the Virtualizor end-user panel.
  • For a hostname: a fully qualified name such as server1.example.com, with an A record pointing to the VPS IP.

Reset the root password in Virtualizor

  1. Log in to Virtualizor and open your VPS.
  2. Go to Settings (or the gear icon) and choose Change Password / Root Password.
  3. Enter a new strong password twice. Use 16+ characters with letters, numbers and symbols, but avoid characters your keyboard layout may type differently in VNC.
  4. Click Save.

On KVM servers the panel may need to restart the VPS to apply the new password, or apply it through the guest agent. Follow the message on screen. On some setups the option only works for Linux templates installed from the panel.

Change the password inside Linux

If you can still log in, simply run:

passwd

Enter the new password twice. This is immediate and needs no restart. For other users use passwd username.

Change the hostname in Virtualizor

  1. Open the VPS and go to Settings → Hostname (or Change Hostname).
  2. Enter the full hostname, for example server1.example.com.
  3. Click Save. A restart may be required for the change to show everywhere.

Change the hostname inside Linux

hostnamectl set-hostname server1.example.com

Then add the name to /etc/hosts next to the server IP, for example 203.0.113.10 server1.example.com server1, so local software can resolve it. Log out and back in to see the new prompt.

Why the hostname matters

  • Control panels such as Plesk and DirectAdmin require a valid FQDN and use it for the panel's SSL certificate.
  • Mail servers use it in their greeting; it should match the IP's reverse DNS. See set rDNS in Virtualizor.
  • Logs and monitoring are easier with a meaningful name.

Security tips

  • After setting a root password, consider disabling password login for SSH and using keys instead.
  • Create a normal user with sudo rights for daily work.
  • Never send the root password by email or chat unencrypted.

Troubleshooting

  • New password does not work over SSH: SSH may not allow root password login (PermitRootLogin prohibit-password). Use VNC or an SSH key.
  • Panel says the action failed: the guest agent is missing or the VPS was installed from an ISO. Use rescue mode to reset the password; see rescue mode.
  • Hostname reverts after reboot: cloud-init may reset it. Set preserve_hostname: true in /etc/cloud/cloud.cfg.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.