Theme editor

Guide Linux How to Reset a Forgotten Linux Root Password on ESXi – Step-by-Step Guide 2025

  • Thread starter Thread starter CL4Y
  • Start date Start date
  • Views 388

CL4Y

Keyboard Ninja
Administrator
Thread owner

🔐 How to Reset a Forgotten Linux Root Password via ESXi – Complete Guide 2025

Can't access your server with the root password? Don't worry! If your server is running as a virtual machine on VMware ESXi, resetting the root password is fairly simple. Just follow the steps below to regain access.



📌 Step 1: Connect to the ESXi Console​

Connect to your ESXi host using the vSphere Client or the Web UI. Reboot the virtual machine where you want to reset the password. While the VM is restarting, continuously press the arrow keys to reach the GRUB/kernel boot screen. Once there, press the E key to enter the kernel parameter editing mode.

⚠️ This method works the same across most Linux distributions. Simply press E at the kernel selection screen to modify boot parameters.

jetto-linux-server-password-reset-1.gif




📌 Step 2: Boot into Rescue Mode​

After entering the GRUB edit mode, scroll to the line that includes the ro parameter and replace it with:
rw init=/sysroot/bin/bash

Then, press CTRL + X to boot the system into recovery mode.

jetto-linux-server-password-reset-2.gif




📌 Step 3: Reset the Root Password​

Once the VM boots into rescue mode, run the following command:
Bash:
chroot /sysroot

Then reset the root password using:
Bash:
passwd root

After successfully setting the new root password, run:
Bash:
touch /.autorelabel

Finally, reboot the virtual machine:
Bash:
reboot

jetto-linux-server-password-reset-3.gif




🔐 Your server is now accessible with the new root password. This method allows you to reset the password without any data loss and regain full control of your system.
 
Back
Top