Next | Prev | Up | Top | Contents | Index

Deleting a User from the System

This procedure deletes the user's home directory and all the files in and below that directory. If you only wish to close or disable a user account but preserve the user's files and other information, see "Locking a User Account".

To delete a user's account completely, follow these steps:

  1. Log in as root.

  2. If you think you might need a copy of the user's files later on, make a backup copy of the directory (for example, on cartridge tape using tar(1) or cpio(1)).

  1. Edit the /etc/passwd file and replace the encrypted password (or ''+'' sign if you are using shadow passwords) with the following string:

    *ACCOUNT CLOSED*

    It is imperative that the asterisks shown in this example be used as shown. An asterisk in the encrypted password field disallows all logins on that account. Alternately, you can lock an account by using fewer than thirteen characters in the password field, but it is better to use the asterisks and an identifiable lock message.

  2. Use find(1) to locate all files on the system that are owned by the user and remove them or change their ownership. Information on the use of find(1) is provided in "Using find to Locate Files" and in the find(1) reference page.

Next | Prev | Up | Top | Contents | Index