How to disable user account?

In Linux systems, you can disable access to an account without changing anything from the account. This is useful if you someone’s access to be locked for a period of time then re-enable it later. To issue this command, you must be logged in as root.

To disable or lock an account:

# passwd -l username

This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).

To enable or unlock an account:

# passwd -u username

This is the reverse of the -l option - it will unlock the account password by removing the ! prefix. This option is available to root only. By default passwd will refuse to create a passwordless account (it will not unlock an account that has only “!” as a password). The force option -f will override this protection.

Popularity: 7% [?]

Share and Enjoy:
  • E-mail this story to a friend!
  • StumbleUpon
  • Digg
  • Technorati
  • del.icio.us
  • Reddit
  • Facebook
  • Google
  • Slashdot
  • Blogosphere News
  • TwitThis
  • NewsVine
  • Propeller
  • Furl
  • Simpy
  • Spurl

Related Posts