ریکاور کردن پسورد VCSA 6.0

ریکاور کردن پسورد VCSA 6.0

This article will provide the step by step screenshot to recover the VCSA 6.0’s  root password and breaking the GRUB password. VMware vCenter Appliance(VCSA) is a pre-configured Linux VM based on SUSE Linux. If you forget the root password of the appliance, you need to recover the root password like other Linux Operating systems. Recovering root password is very simple if there is no grub password has been setup or if you know the GRUB boot loader password. If you don’t know the grub password, then you need to reset the grub password first by using Redhat or SUSE Linux DVD.

 

Environment & Software:

  • VMware vCenter Appliance 6.0  (VM)
  • Redhat Enterprise Linux 7.2 or CENT OS 7.2 ISO

 

Break the GRUB password of VCSA 6.0:

  1. Halt the VCSA 6.0 VM and attach the RHEL 7.0 ISO image in virtual CDROM.
Attach RHEL 7.2 DVD to the VCSA 6.0 VM
Attach RHEL 7.2 DVD to the VCSA 6.0 VM

 

2. Boot the VM in RHEL 7.2 DVD (which we have attached). You can alter the boot device priority in BIOS to make VM to boot from DVD. Navigate to “Troubleshooting” and press enter to continue.

Boot the VM from RHEL 7.2 DVD.
Boot the VM from RHEL 7.2 DVD.

 

3. Select the rescue mode and press enter to continue.

 RHEL7.2 Rescue Mode
RHEL7.2 Rescue Mode

 

4. Select “Continue” to mount the VCSA 6.0’s  root filesystem in Read/write mode under /mnt/sysimage.  RHEL 7.2 is capable to detect the VCSA’s root volume and mounts it.

VCSA 6.0 Continue to mount in RW mode
VCSA 6.0 Continue to mount in RW mode

 

5.  VCSA 6.0’s root filesystem is mounted under /mnt/sysimage and you got the shell to play with this.

VCSA 6.0 Rescue Mount
VCSA 6.0 Rescue Mount

 

6. Navigate to /mnt/sysimage/boot directory and list the contents.

List the mnt-sysimage contents
List the mnt-sysimage contents

 

7. Navigate to grub directory and list the contents. “menu.lst” is the file which holds the GRUB boot loader password.

VCSA 6.0 List GRUB directroie contents
VCSA 6.0 List GRUB directroie contents

 

8. Use “vi” editor to edit the menu.lst file. ( vi menu.lst).

VCSA 6.0 Remove Password line from menu.lst
VCSA 6.0 Remove Password line from menu.lst

*Navigate to password line using arrow keys & press “dd”  to remove the complete line. After that just save the file by pressing key sequence  “:wq” .

 

After the modification,

VCSA 6.0 Password Line Removed
VCSA 6.0 GRUB Password Line Removed

 

9. Exit the shell (Which will reboot the system automatically.). You need to detach the ISO image from VM hardware settings.

VCSA 6.0 Exit the shell
VCSA 6.0 Exit the shell

 

Once the system is booted from hard disk , Just stop the VCSA in GRUB menu to break the OS root password. You could see that GRUB is not protected with password.

 

Reset the VCSA 6.0 ‘s root password: 

1.Start the VCSA 6.0 VM and interrupt the GRUB menu by pressing “ESC” key .  Press “e” edit the commands.

GRUB Menu VCSA 6.0
GRUB Menu VCSA 6.0

If you know the GRUB password , you can pass it by press “p” and enter the GRUB password. If you don’t know the GRUB password , you need to follow the above procedure to break the grub password first.

 

2. Press “e” to edit the commands again for the kernel.

Edit the Kernel Line - VCSA 6.0
Edit the Kernel Line – VCSA 6.0

 

3. Append “init=/bin/bash” in this step and press enter.

Set the shell to pass to kernel
Set the shell to pass to kernel

 

4. Press “b” to boot the system.

Press b to boot from new kernel value VCSA 6.0
Press b to boot from new kernel value

 

5. You will get the bash like below.

Single user Shell for VCSA 6.0
Single user Shell for VCSA 6.0

 

6. Set the new root password for VCSA 6.0.

Set new root password
Set new root password

 

7. Exit the shell using “exit” command.

 

Once the system is booted , you should be able to login with new root password.

Successful login
Successful login

 

Hope this article is informative to you. Share it ! Comment it !! Be Sociable !!!

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *