This will be useful in a situation where you don’t want to permanently remove the user from the system, but just want it disabled so that the user is no longer able to use the system. The user will still receive emails for example, but he will not be able to login and check them out.
The command to "lock (disable) a user account" is
# passwd -l username
With the above command the user account is locked and is available only to root. The locking is performed by rendering the encrypted password into an invalid string by prefixing the encrypted string with an !
The command to "unlock (enable) a user account" is
# passwd -u username
When a user tries to access an locked account, the system will return:
# su - usernameThis account is currently not available.
No comments:
Post a Comment