Loading...

We've detected that your browser language is Chinese. Would you like to visit our Chinese website? [ Dismiss ]
By: Emma

vCenter root password expired

So the root password expired on me, running vcenter server 7.02, I was certain we had set that not to expire but apparently not.

Can I do a Web Console of the Photon OS, reboot it, and follow the instructions for resetting root without causing any issues or downtime with our VMs?

 

– Question from Reddit

Why Your vCenter Root Password Expired

The VCSA root password expires silently. No warning appears in the vSphere Client, and no notification is sent by default. The lockout stems from the appliance operating system, not vSphere itself.

  • 90-day default lifetime: The VCSA enforces a 90-day password lifetime out of the box, shorter than the 365-day default in vSphere 6.5 and earlier.
  • Photon OS-level policy: Expiration is controlled at the Photon OS layer, not by vSphere. Standard vSphere Client banners do not surface alerts for the local root account.
  • No built-in rotation reminder: The countdown starts at deployment. Without external alerting, there is no notification before access is cut off.
  • Expiry and lockout are separate conditions: Expiry is time-based and requires a password update; lockout is triggered by failed attempts and requires clearing a separate counter first.

vcenter root password expired

How to Fix an Expired vCenter Root Password

The right recovery path depends on what credentials you still have access to. Work through the options below from least disruptive to most.

Fix 1: Change via SSH (Password Still Known)

Use this method when the root password has expired but you still remember it.

  1. Open an SSH session to the VCSA and log in as root using the current password.
  2. On vCenter 7.0 U1 and later, the terminal immediately prompts you to set a new password inline. Enter the current password when asked, then set and confirm a new one.
  3. Once the password is updated, your SSH and VAMI access is restored.

reset via ssh

Note: On vCenter 7.0 U1 and later, you can also log in to VAMI at https://<vcenter-fqdn>:5480 as administrator@vsphere.local to reset the root password directly from the interface.

Fix 2: Reset via SSO Admin Without Rebooting (vCenter 6.7 U1+)

Use this method when the root password is expired or forgotten, but administrator@vsphere.local still works. This is the preferred path in production environments because no reboot is needed.

  1. Connect to the VCSA via SSH using administrator@vsphere.local (or another account in the SSO Administrators group).
  2. Enable and enter the bash shell:
    shell
    shell.set --enable true
    shell
    
  3. Switch to the root shell:
    shell
    sudo -i
    
  4. If the root account is locked due to failed login attempts, clear the lockout counter before resetting the password:
    • vCenter 7.x:
    shell
    pam_tally2 --user=root --reset
    
    • vCenter 8.0 U2 and later (Photon OS 4, where pam_tally2 is deprecated):
    shell
    sudo faillock --reset --user root
    
    Note: Running /usr/sbin/faillock --user root --reset on 8.0 U2+ may return a “permission denied” error. Use sudo faillock --reset --user root instead.
  5. Set the new root password:
    shell
    passwd
    
  6. Log in with the new password to confirm the reset. No reboot is required.

Fix 3: Reset via GRUB (No Credentials Available)

Use this method only when both the root password and SSO admin access are unavailable. It requires direct console access to the VCSA virtual machine and involves a reboot.

Tip: Take a snapshot of the VCSA before starting. If the VCSA manages the ESXi host it runs on, connect directly to that ESXi host to take the snapshot.
  1. Restart the VCSA from the vSphere Client or directly from its ESXi host.
  2. When the Photon OS splash screen appears, press e to open the GRUB editor.
  3. Find the line beginning with linux. Move to the end of that line and append:
    text
    rw init=/bin/bash
    
  4. Press F10 to boot. The system starts directly to a root shell without requiring login credentials.
  5. Remount the root filesystem with write permissions:
    shell
    mount -o remount,rw /
    
  6. If the root account was locked, clear the lockout counter (use the same version-specific commands from Fix 2, Step 4).
  7. Set the new password:
    shell
    passwd
    
  8. Reboot the appliance:
    shell
    reboot -f
    
    Note: Running umount / before reboot -f often returns a “target is busy” error in this mode. It is safe to skip it and run reboot -f directly.

Expiry vs. Lockout: What’s the Difference

These two conditions are often confused, and fixing one without addressing the other will leave the root account inaccessible. Here is how they differ:

  • Account expiry (time-based): The password has exceeded its maximum age under the Photon OS chage policy. The system prompts for an update but does not block the account outright.
  • Account lockout (attempt-based): Too many consecutive failed logins have triggered the PAM security module, which blocks all further authentication attempts regardless of whether the password is correct.
  • Both can occur at the same time. If a monitoring script or automation tool keeps trying to log in with a stale password after expiry, it will drive up the failed-attempt counter and trigger a lockout. In that case, resetting the password alone will not restore access — the lockout counter also needs to be cleared.

To check the current state of the root account, run the following from the appliance shell.

Check password aging and expiry details:

shell
chage -l root

Check for active lockouts (use the command that matches your vCenter version):

  • vCenter 7.x:
shell
pam_tally2 --user=root
  • vCenter 8.0 U2 and later:
shell
/usr/sbin/faillock --user root

If the root account keeps locking out shortly after a reset, an external script or monitoring tool is likely retrying with stale credentials. To identify the source, check the SSH authentication logs:

  • vCenter 7.x:
shell
cat /var/log/audit/sshinfo.log
  • vCenter 8.x:
shell
cat /var/log/messages | grep sshd

Configure vCenter Password Expiration Policy

Once root access is restored, adjusting the expiration policy prevents the same issue from recurring. You can do this through the VAMI interface or directly from the CLI.

Adjust Settings via VAMI

  1. Log in to the VAMI at https://<vcenter-fqdn>:5480 as root.
  2. Click Administration in the left navigation pane.
  3. Under Password expiration settings, click Edit.
  4. Set Password expires to No to disable auto-expiration.
  5. Click Save.
Tip: While in this screen, configure an email address for expiry warnings. This gives you advance notice if you later switch back to a time-limited policy.

Adjust Settings via CLI

  1. Connect to the VCSA via SSH and enter the bash shell.
  2. Run the following command to remove all password aging constraints for the root account:
    shell
    chage -I -1 -m 0 -M 99999 -E -1 root
    
  3. Confirm the change:
    shell
    chage -l root
    

If your security policy prohibits credentials that never expire, consider setting a 365-day maximum instead of 90 days. It reduces the risk of unexpected lockouts while staying within most compliance frameworks.

How to Prevent Password Expiration in the Future

Fixing an expired password is straightforward. Preventing it from happening again takes a little more planning, but the steps are simple to build into existing workflows.

Use a secrets manager

The most reliable safeguard is storing VCSA root credentials in an enterprise secrets manager such as HashiCorp Vault or CyberArk. These tools track credential ages and can alert your team before a password reaches its expiration date, removing the dependency on manual tracking.

Set a calendar reminder

For teams without a secrets manager, a recurring calendar reminder works well as a fallback. Set it to fire around day 75 after each password reset — that leaves enough lead time to rotate before the 90-day Photon OS limit is reached.

Add it to your quarterly maintenance checklist

Root password rotation should be part of your standard quarterly VM maintenance checklist. Bundling it with regular patching cycles means it gets done consistently, without requiring a separate process or reminder.

Enable VAMI email notifications

Configure an email notification in the VAMI under Administration > Password Expiration Settings. This gives you an automatic warning a set number of days before expiry — a useful backstop for the times manual processes slip.

Before Fixing, Back Up Your VCSA with i2Backup

The GRUB recovery method in Fix 3 requires a full VCSA reboot, and any misconfiguration at the boot parameter stage can leave the appliance in an unbootable state. Before touching the GRUB menu — or making any system-level change to the appliance — taking a complete backup of the VCSA is the one step that guarantees a safe fallback.

i2Backup is built for exactly this kind of scenario: protecting VMware infrastructure before high-risk operations.

Key Features of i2Backup

  • Agentless VM backup: i2Backup uses native VMware APIs to back up the VCSA as a virtual machine without installing any agent on the appliance itself. The backup runs with zero impact on the production environment.
  • Instant VM recovery: If a GRUB edit goes wrong or the appliance fails to boot, i2Backup can restore the VCSA to a previous state by remotely mounting the VM backup to the target platform, keeping recovery time to a minimum.
  • Flexible backup scheduling: Scheduled backups can run hourly, daily, or at any interval that fits your maintenance window — so the VCSA always has a recent recovery point before planned changes.
  • AES encryption and immutable storage: Backup data is protected in transit with AES encryption and stored in WORM-compliant storage that prevents unauthorized modification or deletion.
  • Centralized management: A web-based console gives your team visibility into backup status, task progress, and alerts across all protected workloads from a single interface.

For teams that need continuous protection beyond scheduled backups, i2Availability provides real-time replication and automated failover for critical systems — keeping services running even when the primary environment goes down.

FREE Trial for 60-Day

Conclusion

An expired VCSA root password is disruptive, but it is also entirely preventable. If you still know the old credential, a quick SSH session is all it takes to restore access. When the root password is gone but SSO admin still works, the no-reboot reset path via administrator@vsphere.local is the faster and safer option for production environments. The GRUB method remains available as a last resort when all other credentials are lost.

Whichever path you took to get back in, two follow-up steps matter: adjust the password expiration policy so the 90-day default does not catch your team off guard again, and make sure a recent VCSA backup exists before the next planned maintenance window. Info2soft’s i2Backup covers that second step — agentless VMware backups with instant recovery, so your team always has a reliable fallback before any system-level change.

For broader vSphere environment health, keeping an eye on other common appliance issues — such as log disk exhaustion on vCenter — helps prevent the kind of cascading failures that turn routine maintenance into emergency recovery.

Emma is the bridge between complex engineering and the people who need it. As a content creator at Info2soft, she spends her days translating "tech-speak" into clear, actionable stories about data resilience. She’s not just documenting software; she's uncovering how data replication and recovery actually change the way businesses run.

More Related Articles

Table of Contents:
Stay Updated on Latest Tips
Subscribe to our newsletter for the latest insights, news, exclusive content. You can unsubscribe at any time.
Subscribe
Ready to Enhance Business Data Security?
Start a 60-day free trial or view demo to see how Info2soft protects enterprise data.
Please fill out the form and submit it, our customer service representative will contact you soon.
By submitting this form, I confirm that I have read and agree to the Privacy Notice.
{{ isSubmitting ? 'Submitting...' : 'Submit' }}