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 anArecord pointing to the VPS IP.
Reset the root password in Virtualizor
- Log in to Virtualizor and open your VPS.
- Go to Settings (or the gear icon) and choose Change Password / Root Password.
- 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.
- 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:
passwdEnter the new password twice. This is immediate and needs no restart. For other users use passwd username.
Change the hostname in Virtualizor
- Open the VPS and go to Settings → Hostname (or Change Hostname).
- Enter the full hostname, for example
server1.example.com. - Click Save. A restart may be required for the change to show everywhere.
Change the hostname inside Linux
hostnamectl set-hostname server1.example.comThen 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
sudorights 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: truein/etc/cloud/cloud.cfg.
