How to freeze Unix accounts

In general, unless you know that the files in some former employee’s home directory are of no further value (e.g., maybe just a standard set of files for starting up common applications), it is a better idea to lock an account than remove it and its contents. Unix systems offer a number of ways to freeze accounts without emptying them. 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.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis