• 1-888-289-2246
  • 24x7x365 Presence

Lock/unlock a Linux user account


There are times when we need to remove a user account that is not in use but sometime later we’ll need that again and then we always think at that time that if we hadn’t removed that account we could have used it.

So there is a good way in Linux by which we can make an account unusable until an administrator wants to make it usable again, i.e. we can lock the account.

We can lock a user account in Linux and then that account won’t be accessible until the administrator unlocks it. Below is the process to do this.

To lock a user account, use the command below:-

passwd -l username

To unlock a user account, use the command below:-

passwd -u username

]]>


Leave a Reply

Your email address will not be published. Required fields are marked *