1 2 Previous Next 18 Replies Latest reply on May 2, 2017 4:11 PM by sathyay2k

    Lost vCenter root password

    beval Lurker

      Hi all,

       

      our vadp backup stopped working and I can't log to vSphere console as an vadp user. So I thing there is something wrong with a password of the vadp user. But I found I forgot my root password to vCenter Server Appliance 5.1 (built on Linux). Is there any chance to change it?

      Thanks for any ideas.

       

      Pavel

        • 1. Re: Lost vCenter root password
          JoaoCastro Enthusiast
          vExpert

          The Vmware appliances are Suse linux based, so you can try one this methods below to reset your root password:

          Link:

          SDB:Recover root password - openSUSE

           

          regards,

          Joao Castro

          1 person found this helpful
          • 2. Re: Lost vCenter root password
            JD Hot Shot
            vExpert

            To reset the root user password in the vCenter

            1. Boot the virtual appliance and navigate to the console for the virtual machine in the vSphere Client.
            2. Click in the console and press any key to display the GRUB menu.

              Note: The GRUB prompt remains on screen for 7 seconds before it starts the boot sequence.

            3. On the GRUB menu, select SUSE Linux Enterprise Server for VMware.
            4. Type e to edit the line. A list of items in the GRUB configuration file appears.
            5. Select the line that starts with kernel and type e to edit the line.
            6. At the end of the line, press the spacebar and type init=/bin/sh.
            7. Press Enter to exit edit mode.
            8. On the GRUB screen, type b to boot into single-user mode.
              The virtual appliance boots in single-user mode.
            9. To change the root user password, type passwd root and follow the on-screen prompts.
            10. To restart the virtual appliance, type reboot and press Enter.

            When the virtual appliance restarts, you can log in using the new password.

            http://www.myitblog.in/
            • 3. Re: Lost vCenter root password
              beval Lurker

              I have read the procedure. There is a problem with a password I'm asked when I try open the GRUB menu. There is also no "SUSE Linux Enterprise Server for VMware" but only "VMware vCenter Server Appliance" as the first option and "Failsave -- VMware vCenter Server Appliance" as the second. I can select one of the options or press "p" to enter a password to unlock the next set of features.

              • 4. Re: Lost vCenter root password
                beval Lurker

                Hi, I tried both options: boot with rescue CD and Single User option also.

                First option with rescue CD failed when I tried mount /dev/sd* with command:

                 

                mount -o remount,rw /dev/sdb2 /mnt/

                 

                error message is:

                 

                mount: /mnt not mounted or bad option

                 

                IfI use ls /dev/sd* I can see:

                 

                /dev/sda     /dev/sda2     /dev/sdb     /dev/sdb2

                /dev/sda1     /dev/sda3     /dev/sdb1     /dev/sdb3

                 

                No /dev/hda* is presented.

                 

                Second option using the Single User mode failed because there is a password locked GRUB. I don't know this password. The only option I can see in the GRUB boot menu is to enter a password for more options.

                • 5. Re: Lost vCenter root password
                  LP Novice

                  Hi,

                   

                  If you are still looking for a solution ..Can u paste output of following commands after you boot from the Rescue CD

                  df -h

                  fdisk -l

                  dmesg |grep sd

                   

                  Probably sdb2 is not the root filesystem.

                  Are you sure you are using the OpenSUSE install CD as the Rescue CD ?

                   

                  -LP

                  • 6. Re: Lost vCenter root password
                    beval Lurker

                    Hi,

                     

                    I finally found the solution with VMware support.

                     

                    Solution:

                     

                    1. Follow the manual http://en.opensuse.org/SDB:Recover_root_password:
                      1. Boot from SuSE Install CD/DVD:
                      2. select Recovery
                      3. log on as root without password
                      4. fdisk -l to detect a system partition
                      5. mount /dev/sda3 /mnt (where /dev/sda3 is the system partition) to mount
                    2. Reset the root password
                      1. do a backup of a shadow file with passwords: cp /mnt/etc/shadow /mnt/etc/shadow-bak
                      2. edit the shadow file: vi /mnt/etc/shadow (see Understanding /etc/shadow file)
                      3. DO NOT delete passwords, you can't log on with no password
                      4. I fortunately have created one other user with a password I know. I copied a hashed form of the password from this user to root. Maybe there is another way to get a hashed form of some word and put it to root if you don't have other user created with a known password.
                      5. I can log on as root after reboot.

                     

                    Thanks to all. Pavel

                    • 7. Re: Lost vCenter root password
                      IndraPutu Lurker

                      i was able to reset the root password based on your steps, thanks

                      • 8. Re: Lost vCenter root password
                        smolz Lurker

                        JD wrote:

                         

                        To reset the root user password in the vCenter

                        1. Boot the virtual appliance and navigate to the console for the virtual machine in the vSphere Client.
                        2. Click in the console and press any key to display the GRUB menu.

                          Note: The GRUB prompt remains on screen for 7 seconds before it starts the boot sequence.

                        3. On the GRUB menu, select SUSE Linux Enterprise Server for VMware.
                        4. Type e to edit the line. A list of items in the GRUB configuration file appears.
                        5. Select the line that starts with kernel and type e to edit the line.
                        6. At the end of the line, press the spacebar and type init=/bin/sh.
                        7. Press Enter to exit edit mode.
                        8. On the GRUB screen, type b to boot into single-user mode.
                          The virtual appliance boots in single-user mode.
                        9. To change the root user password, type passwd root and follow the on-screen prompts.
                        10. To restart the virtual appliance, type reboot and press Enter.

                        When the virtual appliance restarts, you can log in using the new password.

                        This method does actually work quite well.  Instead of " On the GRUB menu, select SUSE Linux Enterprise Server for VMware" just choose the second option "Failsafe" then continue from step 4.  Just did this on a vCenter 5.5.0.5101 appliance.

                        • 9. Re: Lost vCenter root password
                          speeddensity Lurker

                          You might need to press "p" at step 4 and enter "vmware" as the password to allow you to then perform the edit.

                          Ive just done this now...

                          • 10. Re: Lost vCenter root password
                            sigma222 Lurker

                            Thank you. Worked like a charm for me.

                            • 11. Re: Lost vCenter root password
                              itsolution Novice

                              I believe this is "best practice".

                               

                              kb.vmware.com/kb/2069041

                              • 12. Re: Lost vCenter root password
                                JRHelgeson Novice

                                Pavel,

                                Thank you for this post. It was exactly what I needed. However, rather than modify the shadow file using vi, I noticed that there was a "shadow.old" file that was created by the vSphere installer.  I simply renamed my shadow file and copied the shadow.old to shadow.

                                1. Follow Solution steps 1 below
                                2. Reset the root password
                                  1. view the contents of the directory: ls -l /mnt/etc/shadow*
                                    1. I saw "shadow" and "shadow-old", the latter had a date stamp of around the original install date.
                                    2. I compared the contents of each cat /mnt/etc/shadow and cat /mnt/etc/shadow-old doing a 'stare and compare' and seeing that the only difference was the hash value for the user 'root'.
                                  2. Rename shadow to shadow.bak: mv /mnt/etc/shadow /mnt/etc/shadow-bak
                                  3. Copy shadow-old to shadow: cp /mnt/etc/shadow-old /mnt/etc/shadow
                                  4. Verify: ls -l /mnt/etc/shadow*
                                    1. You should see shadow, shadow-old, shadow-bak - and possibly others - but you MUST have 'shadow' file, otherwise you're in a world of hurt.
                                  5. Reboot - I was then able to login as root | vmware

                                Hi,

                                 

                                I finally found the solution with VMware support.

                                 

                                Solution:

                                 

                                1. Follow the manual http://en.opensuse.org/SDB:Recover_root_password:
                                  1. Boot from SuSE Install CD/DVD:
                                  2. select Recovery
                                  3. log on as root without password
                                  4. fdisk -l to detect a system partition
                                  5. mount /dev/sda3 /mnt (where /dev/sda3 is the system partition) to mount
                                2. Reset the root password
                                  1. do a backup of a shadow file with passwords: cp /mnt/etc/shadow /mnt/etc/shadow-bak
                                  2. edit the shadow file: vi /mnt/etc/shadow (see Understanding /etc/shadow file)
                                  3. DO NOT delete passwords, you can't log on with no password
                                  4. I fortunately have created one other user with a password I know. I copied a hashed form of the password from this user to root. Maybe there is another way to get a hashed form of some word and put it to root if you don't have other user created with a known password.
                                  5. I can log on as root after reboot.

                                 

                                Thanks to all. Pavel

                                • 13. Re: Lost vCenter root password
                                  eRJe Novice

                                  Thanks for your remark! After spending half a morning trying to reset the password according to the "official" procedure, I finally succeeded by choosing fail-safe mode instead of the normal mode.

                                  • 14. Re: Lost vCenter root password
                                    rev22 Lurker

                                    Thank you - these posts were quite helpful. Although in my situation, the use of shadow.old did not work. A "stare and compare" of all shadow files had the root password string the same. A 'cat' of the shadow.YaST2save file showed there was no password string for root. After seeing this and having few options, I ended up blanking the password string for root in the live ‘shadow’ file then upon reboot there was a message on DCUI main screen stating the root password needed reset. I chose F2 to login to the DCUI and I was prompted to set a new password. So I set a new one, it was accepted and it logged me in. This was on a VCSA 6.0 appliance. I thought this was an interesting twist that I didn't see in any research so I thought I would enter it here.

                                    1 2 Previous Next