Check password expiration date of ESXi root user.
search cancel

Check password expiration date of ESXi root user.

book

Article ID: 414505

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides commands to check password expiration date of ESXi root user.

Environment

VMware vSphere ESXi

Resolution

Execute command at ESXi SSH session.

ChangedDay=$(cat /etc/shadow | grep root | awk -F ":" '{print $3}') &&  MaxDays=$(cat /etc/shadow | grep root | awk -F ":" '{print $5}') && date -d "1970-01-01+$((($ChangedDay+$MaxDays-1)*24))"

For example:

Please note in the output, only expiration date is valid, the time isn't accurate.

Additional Information

Please also refer to the Broadcom Knowledge Base (KB) article How to check the last password change date for the ESXi root user.