Don't Miss

Howto Lock or Freeze an Account

By on January 14, 2013
Howto Lock or Freeze an Account

Howto Lock or Freeze an Account
Freeze an account is to lock or disabling a user access. Whether you remove accounts in their entire along with perhaps gigabytes of files or only disable them so that no one can log into them is a choice that must be made with some knowledge of how the accounts were being used or a good policy that tells you who makes decisions about user accounts on various servers or applications.

The “userdel” command, for example, will generally not remove the contents of a user’s home unless a -r (remove) or -f (force) argument is used along with it. Instead, the command will do no more than remove the user’s /etc/passwd and /etc/shadow entries.

Another option is to insert a special character in front of the password hash in the /etc/shadow file. And I say “special” only because using a character such as ! will make your intention clear while any other character is more likely look like it’s simply a part of the hash. The “usermod” command on Linux systems does exactly that. It provides a lock option (-L) that inserts an exclamation point (!) in front of the password hash as described. If you need to unfreeze the account later, the usermod -U command will unlock it, removing the inserted!

Things you should do on a Unix system before removing an account is check to see whether the person has any processes that might still be running. He or she may have have left processes running or may have active logins. You can easily check with a “ps -U username” command.

About jonboy60

Contact Me for computer repair services, mobile repair services, website repair services, website maintenance, creating website, domain name, hosting services, career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting, wordpress web consulting & development and expertise requests. Currently reside in Rawang, Selangor. Email to me on jonboy60{@}

Leave a Reply

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