How do I disable a linux account?
amurleopard last edited by
-E, --expiredate EXPIRE_DATE Set the date or number of days since January 1, 1970 on which the user's account will no longer be accessible. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again. Passing the number -1 as the EXPIRE_DATE will remove an account expiration date.
This will disable the user account.
$ chage -E0 testuser
This will disable all method of access by Linux Pluggable Authentication Modules (PAM). For information on PAM see this wikepedia link: https://en.wikipedia.org/wiki/Linux_PAM
© Lightnetics 2020