If you have lost your root password and cannot log in via SSH, don't worry. You can reset it by booting your VPS into Rescue Mode. This allows you to access the hard disk as a secondary drive and modify the password file.
Step 1: Boot into Rescue Mode
- Log in to the MyTilaa Dashboard.
- Go to VPS and select your server.
- Under Tasks, click Start in rescue mode.
- Wait until the status changes to Rescue Mode.
- Open the Video Display console (or connect via SSH if you configured keys).
Step 2: Identify and Mount the Disk
Your server's disk is attached but not yet mounted. We first need to find the correct partition.
1. List all storage devices:
lsblk
Look for the largest partition. Usually, this is /dev/vda1 or /dev/vda2.
2. Mount the partition to a temporary folder:
mkdir /mnt/recovery
mount /dev/vda1 /mnt/recovery
(Note: If vda1 is small (~500MB), it's likely the boot partition. Unmount it and try vda2).
Step 3: Change the Password
Now we use chroot (Change Root) to make the mounted disk behave like the active system.
1. Enter the environment:
chroot /mnt/recovery /bin/bash
2. Change the password:
passwd root
Type your new password twice.
If your OS uses SELinux (standard on RedHat-based systems), you must run the following command before exiting. If you skip this, you will be locked out after rebooting.
touch /.autorelabel
3. Exit the environment:
exit
Step 4: Reboot
1. Unmount the disk to ensure data is saved:
umount /mnt/recovery
2. Reboot the server:
reboot
3. In the Tilaa Dashboard, ensure the server switches back to Normal Boot mode (or click 'Stop Rescue Mode').