usermod -e 1 *username*
will have the effect of expiring a user account but
usermod - L *username*
will lock the said account.
Are there any specific differences between the two? In my opinion, either one of them should achieve the goal of locking out a user from authenticating their account. Why would we need an expiration mechanism when one could lock/or delete the account in question?
userdel -r
would do ?userdel -r <username>
. The home directory and the account will NOT be removed from/etc/passwd
,/etc/group
and/etc/shadow
files.