This information can be gathererd using the passwd
utility.
From man passwd
-S, --status
Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password
(L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and
inactivity period for the password. These ages are expressed in days.
To check the status of every user on the system, run
passwd -a -S
A disabled (locked) user might look like this:
apache L 08/30/2019 0 99999 7 -1
Note the L
, indicating the account is locked.
A regular user might look like this:
panki P 09/23/2019 0 99999 7 -1
/etc/shadow/
. The second field is the password. When it starts with double exclamation mark!!
, the account is locked. Runadduser
with different options and explore the effect on the new user's line in the shadow file.adduser
, but it's not the same command as on Linuxen, and doesn't have those flags. Also, on Debian,adduser
is a Perl script that callsuseradd
, on FreeBSD it's described as a shell script that uses thepw
command. Actually, it's not even the same command across different Linuxes, as in CentOS, it appears to be a link touseradd
...