Changing an ESXi/ESX host root password
search cancel

Changing an ESXi/ESX 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.

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

Environment

VMware vSphere ESXi 6.7
VMware ESXi 4.0.x Embedded
VMware vSphere ESXi 6.5
VMware ESXi 4.0.x Installable
VMware ESXi 3.5.x Embedded
VMware ESX 4.0.x
VMware ESX Server 3.5.x
VMware vSphere ESXi 6.0
VMware ESXi 4.1.x Installable
VMware ESXi 4.1.x Embedded
VMware vSphere ESXi 5.0
VMware ESX 4.1.x
VMware ESX Server 2.5.x
VMware vSphere ESXi 5.1
VMware ESXi 3.5.x Installable
VMware ESX Server 3.0.x
VMware vSphere ESXi 7.0.0
VMware vSphere ESXi 5.5

Resolution

Caution: Do not change the ESXi/ESX password when the ESXi/ESX host is connected to a Lab Manager Environment. For more information, see An ESX host is unavailable after its password is changed (1011209).

  1. Log in to the ESXi/ESX host service console, either via SSH or the physical console.
     
  2. If you did not log in as root, you must 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. You are warned about, but not prevented from using, bad passwords.

    If you make a mistake when typing or retyping the new root password, you must start over. For 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.
    #
Notes:
  • In ESXi 3.5 and later versions, reinstalling the ESXi software is the only supported way to reset a password if the root password is forgotten. Any other method may lead to a host failure or an unsupported configuration due to the complex nature of the ESXi architecture. ESXi does not have a service console, and the traditional Linux methods of resetting a password, such as single-user mode, do not apply.
     
  • If you have forgotten or do not know the password for the root user on an ESX host, you cannot recover the original password. However, you can change the root password. For more information, see Changing a forgotten root password on an ESXi/ESX host (1317898).


Additional Information

For more information on security best practices, see the VMware Technical Paper, VMware Infrastructure 3 Security Hardening.

For translated versions of this article, see: For related information, see:

Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).An ESX host is unavailable after its password is changed
Using Tech Support Mode in ESXi 4.1, ESXi 5.x, and ESXi 6.x
Changing a forgotten root password on an ESX/ESXi host
Cambiar la contraseña raíz del host ESX
Como alterar uma senha raiz do host ESX
ESXi/ESX ホストの root パスワードの変更
更改 ESXi/ESX 主机 root 密码
Ändern des root-Kennworts für einen ESXi/ESX-Host