If you have forgotten the ESXi host root password or it does not work due to locked account or expired password, we can try below methods to access the Host :-
Method 1 : If the Host has access to Active Directory authentication and is in connected state in vCenter –
Login to the ESXi host using domain account and reset the local root account password.
Method 2 : Using Host profile.
NOTE: Host Profile needs Enterprise Plus license for ESXi host or else with an evaluation license.
1. Extract a Host profile from the same host where we have the password issue
2. Edit the newly created Host profile
3. Go to Security and Services -> Security Settings -> Security -> User configuration -> Root
4. Select “Fixed password configuration” and set the new password and click on Finish
Set the password
5.Attach the profile to the ESXi host and check Host compliance
6. You will see that the Host is not compliant with password difference
7. Remediate the Host against newly created Host Profile. Right click on host -> Host profile -> Remediate. Uncheck the reboot option.
8. Try to access the Host with the new root password, you should be able to login to host.