TOKEN=$(curl -d '{"username" : "<sso_username>", "password" : "<sso_password>"}' -H "Content-Type: application/json" -X POST http://127.0.0.1/v1/tokens | jq -r '.accessToken')
curl -k -X GET -H "Authorization: Bearer "$TOKEN"" --insecure 'https://localhost/v1/system/credentials/service' | json_pp | less
Sample output
{
"serviceType" : "SDDC_MANAGER",
"entityId" : "9189####-####-####-####-########8251",
"username" : "svc-vcf-####-##",
"id" : "688d####-####-####-####-########ad5e",
"entityType" : "ESXI",
"targetType" : "ESXI",
"serviceId" : "2f7a####-####-####-####-########cb79",
"secret" : "##############",
"credentialType" : "SSH",
"creationTime" : 16#######96,
"modificationTime" : 16#######96
Once you have the service account password you can connect to the ESXi host with the service account to clear out a root lockout or to reset the root password.