Locking A Linux Users Login

Sometimes you need to lock a user out of a system on a temporary basis, maybe they didn’t pay that last bill you sent? Luckily this can be done really easily with the passwd command.

i.e passwd -l username

This adds a ! character to the start of the users encrypted password making it invalid. When you want to unlock the account the process is easily reversed using the passwd again but this time with the -u prefix.

i.e passwd -u username

Read More