Installation guide
9.4.3 Removing a User’s Files and Directories
Before removing files or directories from the user’s account, follow these
steps:
1. Make sure that the associated files and directories are not being used
by other users on your system.
2. Back up the user’s login directory to diskette or tape. Refer to
Chapter 11 for more information.
To remove a user’s files and directories:
1. Use the rm -r
login_dir
command to remove the user’s login
directory (including all of the directory’s files and subdirectories). For
example, to remove the login directory (including all of the files and
subdirectories) for user marcy, enter:
# rm -r /usr/users/marcy
2. Use the rm
mail_dir
command to remove the user’s mail directory.
For example, to remove the mail file for user marcy, enter:
# rm /usr/spool/mail/marcy
3. Use the find command to ensure that no files remain that were
owned by the user. For example, to verify that user marcy no longer
owns files, enter:
# find /usr/users -user marcy -print
The find command locates user files that are links (identified by a
notation of >1), user files within directories (identified by a notation of
1), or user directories (identified by a notation of 2). Refer to find
(1)
for more information.
4. If the find command locates any user files or directories, use the
chown command to change the ownership to a different user (one who
still needs to access the file). If there is no reason to save or maintain
these files, remove them.
5. Remove the user’s crontab and atjobs files if they exist. For
example:
# rm /var/spool/cron/crontabs/marcy
# rm /var/spool/cron/atjobs/marcy
9.4.4 Removing a User’s Account from the group File
Since users can be members of more than one group, modify all line entries
in the group file that contain the user name within the
user
field.
Administering User Accounts and Groups 9–19