Enabling or disabling Lockdown mode on an ESXi host
search cancel

Enabling or disabling Lockdown mode on an ESXi host

book

Article ID: 336894

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

To increase the security of ESXi hosts, they can be placed in Lockdown mode. This article provides information on enabling or disabling Lockdown mode on an ESXi host.

Environment

VMware vSphere ESXi 6.x
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x
VMware vSphere vCenter Server 6.x
VMware vSphere vCenter Server 7.x
VMware vSphere vCenter Server 8.x

Resolution

ESXi 6.x and above:
 
Starting with vSphere 6.0, select normal Lockdown mode or strict Lockdown mode, which offer different degrees of lockdown.
 
Normal Lockdown mode:

In normal lockdown mode the DCUI service is not stopped. If the connection to the vCenter Server is lost and access through the vSphere Web Client is no longer available, privileged accounts can log in to the ESXi host's Direct Console Interface and exit lockdown mode. Only these accounts can access the Direct Console User Interface:
 
  • Accounts in the Exception User list for lockdown mode who have administrative privileges on the host. The Exception Users list is meant for service accounts that perform very specific tasks. Adding ESXi administrators to this list defeats the purpose of lockdown mode.
    • For adding a normal service account to the Exception User list, see Specify Lockdown Mode Exception Users 
    • Should a domain user account need to be added to the Exception Users List, this must be done at the ESXi host level with process below:
      • See below: To Add Domain user account to the Exception Users List
  • Users defined in the DCUI.Access advanced option for the host. This option is for emergency access to the Direct Console Interface in case the connection to vCenter Server is lost. These users do not require administrative privileges on the host.
Strict Lockdown mode:
 
In strict lockdown mode the DCUI service is stopped. If the connection to vCenter Server is lost and the vSphere Web Client is no longer available, the ESXi host becomes unavailable unless the ESXi Shell and SSH services are enabled and Exception Users are defined. If the connection to the vCenter Server system cannot be restored, reinstall of ESXi may be required.
 
 
To enable or disable Lockdown mode from the DCUI:
  1. Log directly in to the ESXi host.
  2. Open the DCUI on the host.
  3. Press F2 for Initial Setup.
  4. Press Enter to toggle the Configure Lockdown Mode setting.
To enable or disable Lockdown mode from the vSphere Web Client:
  1. Browse to the host in the vSphere Web Client inventory.
  2. Click the Manage tab and click Settings. (with 6.7, Click the Configure tab)
  3. Under System, select Security Profile.
  4. In the Lockdown Mode panel, click Edit.
  5. Click Lockdown Mode and select one of the lockdown mode options.
Add Domain user account to the Exception Users List
  1. The process is outlined here: Assign Permissions to a User for an ESXi Host in the VMware Host Client
  2. Right-click Host in the VMware Host Client inventory and then select Permissions.
  3. Click Add user.
  4. Click the Select a user text box and type in the domain user account (i.e DOMAIN\userAccountName)
  5. Click the arrow next to the Select a role text box and select Administrator from the list.
  6. Click Add and then select Close.
  7. Follow the Steps here Specify Lockdown Mode Exception Users
  8. After this is done, enable Lockdown Mode (normal) in the vSphere Client UI (vCenter Server GUI) and then attempt logging into the DCUI and shell for the ESXI host with the domain user account.

Add host permissions to the user

  1. click on Host (left pane) and select Actions>>Permissions or 
  2. Right-click Host in the VMware Host Client inventory and then Permissions.
  3. click on Add user, and add the user to the administrator role
  4. Select Save

 

ESXi 5.x and prior:

When enabling Lockdown mode, only the vpxuser has authentication permissions. Other users cannot perform any operations directly on the host. Lockdown mode forces all operations to be performed through vCenter Server. A host in Lockdown mode cannot run vCLI commands from an administration server, from a script, or from the vMA on the host. In addition, external software or management tools might not be able to retrieve or modify information from the ESXi host.

Lockdown mode can be enabled from the Direct Console User Interface (DCUI).

Notes:
  • These procedures are for ESXi only.
  • The host profile does not have a setting to enable or disable Lockdown mode.
  • Configure Lockdown Mode will be grayed out if vCenter is down or the host is disconnected from vCenter.
  • None of the troubleshooting services will work after Lockdown mode is enabled.

If Lockdown mode is enabled or disabled using the DCUI, permissions for users and groups on the host are discarded. To preserve these permissions, enable or disable Lockdown mode using the vSphere Client connected to vCenter Server.

To enable Lockdown mode:

  1. Log directly in to the ESXi host.
  2. Open the DCUI on the host.
  3. Press F2 for Initial Setup.
  4. Press Enter to toggle the Configure Lockdown Mode setting.

Using troubleshooting services

By default, troubleshooting services in ESXi hosts are disabled. These services can be enabled if necessary. Troubleshooting services can be enabled or disabled irrespective of the Lockdown mode on the host.

The various troubleshooting services are:

  • Local Tech Support Mode (TSM): Enable this service to troubleshoot issues locally.
  • Remote Tech Support Mode Service (SSH): Enable this service to troubleshoot issues remotely.
  • Direct Console User Interface Service (DCUI): When enabling this service while running in Lockdown mode, log in locally to the Direct Console User Interface as the root user and disable Lockdown mode. Then troubleshoot the issue using a direct connection to the vSphere Client or by enabling Tech Support Mode.

Note: To check the status or disable Lockdown mode when Lockdown mode is already enabled, enter the Direct Console User Interface Service (DCUI) and then run these commands on the ESXi host.

 

Enabling or disabling Lockdown mode using PowerCLI

To enable Lockdown mode using PowerCLI, run this command (Replace <hostname> with the actual host name):

(get-vmhost <hostname> | get-view).EnterLockdownMode() | get-vmhost | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}} | ft -auto

Example: (get-vmhost esxi01.acme.com | get-view).EnterLockdownMode() | get-vmhost | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}} | ft -auto

To disable Lockdown mode, run this command (Replace <hostname> with the actual host name):

(get-vmhost <hostname> | get-view).ExitLockdownMode()

Example: (get-vmhost esxi01.acme.com | get-view).ExitLockdownMode()

To batch modify Lockdown mode using PowerCLI, save this text in a *.PS1 file and run with PowerCLI:

 
$vCenter = 'vCenterServer_Name_or_IP_address'
Connect-VIServer $vCenter
$Scope = Get-VMHost #This will change the Lockdown Mode on all hosts managed by vCenter
foreach ($ESXhost in $Scope) {
(get-vmhost $ESXhost | get-view).ExitLockdownMode() # To DISABLE Lockdown Mode
#(get-vmhost $ESXhost | get-view).EnterLockdownMode() # To ENABLE Lockdown Mode
}
Disconnect-VIServer -Server $vCenter -Confirm:$false