Saturday, July 31st, 2010

How To Change Lost Password on Your ESX Server

6

Doing a few experiments with VMware ESX 3.5 today, I've made a typo (twice!) when setting up a password for one of the systems, and this resulted in me locking myself out of ESX server upon the completion of its install.

Luckily, there's a rather easy way to change the forgotten password to something new, and I thought I'll explain how it can be done.

Changing the root password on ESX server

You will need to have access to the serial console of the server which has your ESX installation, or access to keyboard and display attached directly to the same box.

To change the password, we'll follow this procedure:

1) Reboot ESX server.

Unfortunately, if you don't remember your root password, there won't be a clean way to reboot your server. Try to shutdown all the VMs running on it, and then power-cycle the box running ESX.

2) Boot ESX server in single user mode

In this mode, you won't be asked for a root password. When you see the following screen, press the "a" key:

… to change ESX kernel boot parameters. Your screen will look like this:

Now, simply type a space and "single" word, then press Enter:

Eventually, your ESX server will boot and give you a root command line prompt, which means you can do what you want from this moment on:

Assuming you want to change your root password, move on to the next step.

3) Change ESX root password to a new one

Simply type "passwd" and give your new password twice:

sh-2.05b# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

That's it! You have changed the ESX password! Now it's time to reboot the system and allow ESX server to come back up online.

4) Reboot ESX server once again

Type "reboot" and wait for the ESX server to come back online in a few minutes:

sh-2.05# reboot

Are you a seasoned ESX administrator? Do you solve the forgotten root password problem differently? Please share your opinions in the comments section.

See also:

Comments

6 Responses to “How To Change Lost Password on Your ESX Server”
  1. rred says:

    HI!
    THANKS A LOT ! Works like charm!!!!

  2. bk says:

    One thing I found to be true when entering "single" mode in reference to this step
    … to change ESX kernel boot parameters. Your screen will look like this:

    If there is any text after mem-272 make sure you back the cursor to
    mem-272M _

    It took me a while to figure that out. It doesn't work if you type in 'single' at the end of the line. I had to erase everything up to mem-272M

  3. Gleb Reys says:

    Thanks, BK!

    I haven't played with this, so it's very good that you've spotted the importance of command line wording.

Trackbacks

Check out what others are saying about this post...
  1. [...] and away you go. I won't bother to repeat the steps for getting into single user mode; go to this article and it will give you what you need (the article is written for ESX 3.5 but it works fine for ESX [...]



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!