You can easily found “how to reset the root password on ESX” articles on the web for an example VMware KB article 1317898, xtravirt, or Petri.

However, unauthorized entry into single user mode is a risk. For security enhancement, you should enable password protect GRUB and enable root password for single user mode on vSphere 4.

How To Enable Root Password for Single User Mode on vSphere 4

  • Login to vSphere server as root
  • Edit /etc/inittab file
  • # vi /etc/inittab
  • Insert “~~:S:wait:/sbin/sulogin” and reboot
  • inittab

    What is this mean?
    man inittab shows
    id:runlevels:action:process
    id = is a unique sequence of 1-4 characters which identifies an entry in inittab
    runlevels = lists the runlevels for which the specified action should be taken
    action = describes which action should be taken.
    process = specifies the process to be executed.
    S = Single user mode
    wait = The process will be started once when the specified runlevel is entered and init will wait for its termination.

  • You should be able to see password prompt during single user mode boot up
  • Enable Root Password for a Single Mode

Password protecting GRUB
Note: This may NOT really helpful to anyone of you because you’re require to enter password during boot up.

  • Login to vSphere server as root
  • Type: # /sbin/grub-md5-crypt
  • Copy the encrypted password(e.g.$1$LgZD4/$vgg6d30on18oNlUB6FVew1) and paste into /boot/grub/grub.conf as example show below
  • You’re prompt to enter GRUB password as you enter just now before server boot up

Enable GRUB password