Changing the ESXi host root password
search cancel

Changing the ESXi host root password

book

Article ID: 318960

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to change the root password on an ESXi host.

​​​​​​​For security reasons, it may be necessary to change the password for the root user on an ESXi host after installation.

Environment

VMware ESXi 6.X
VMware ESXi 7.X
VMware ESXi 8.X

Resolution

Using the Direct Console User Interface (DCUI)

  1. Connect a monitor and keyboard directly to the ESXi host; or access the remote management interface (iDRAC, iLO, etc).

  2. At the ESXi welcome screen, press F2 to access the System Customization menu.

  3. Log in as the root user with the current password.

  4. Navigate to "Configure Password" in the menu.

  5. Follow the prompts to enter and confirm the new password.

  6. Exit the DCUI after successfully changing the password.


Using the ESXi Shell

  1. Log in to the ESXi host console, either via SSH or the physical console.
     
  2. Log in as root or acquire root privileges by running the command:

    $ su -

    Enter the current root password when prompted.
     
  3. Change the root password by executing:

    $ passwd root
     
  4. Enter the new root password, and press Enter. Enter the password a second time to verify. There may be a warning about being prevented from using bad passwords.

    If a mistake was made when typing or retyping the new root password, restart the process. Example:

    $ passwd root
    Changing password for user root.
    New UNIX password:
    Retype new UNIX password:
    Sorry, passwords do not match
    New UNIX password:
    Retype new UNIX password:
    passwd: all authentication tokens updated successfully.

Additional Information

Note:

If the root password is forgotten, refer to Reset ESXI password through Host Profile.