Home   Profile   Fun
#139 Linux  03.06.2007

How to disable a Linux user account


Instead of erasing an user account from a machine it is sometimes more convenient to just disable it. As long as it is disabled the user cannot login to the system. What happens is that the password hash of this user account in /etc/shadow is made invalid. Later on it can be enabled again and all data like home directory, password etc. is unchanged.

Disable an user account
passwd -l username

Enable an user account again
passwd -u username