Click to See Complete Forum and Search --> : Killin' users


viscia
09-30-2001, 11:48 PM
Is there a secred opposite to the adduser command? Supposing there isn't, what does one need to erase other than home directories to eliminate all traces of a user?

xDAVIDx
09-30-2001, 11:52 PM
userdel -r username

removes entries in /etc/passwd, /etc/shadow, /etc/group.

removes home directory and mail spool...

files in other places will have to be searched for and deleted manually

[ 30 September 2001: Message edited by: xDAVIDx ]

Craig McPherson
10-01-2001, 12:39 AM
Or if you want to do it the hard way:

1. rm -rf the home dir and the mail spool (usually /var/spool/mail/username) -- or better yet, concatenate the user's mail spool onto your own before you delete it, because reading other people's e-mail is leet, and be sure to extract any pr0n and other goodies from the home directory before you delete it.

2. Edit /etc/passwd and /etc/shadow, and delete the user's line in each file.

3. If the user had a group named after him, delete that group in /etc/group, and also remove the user from any secondary groups he was a member of.

4. (Optional) Add an alias in /etc/aliases so that any incoming mail addressed to the now-deceased user is re-forwarded to billg@microsoft.com and/or president@whitehouse.gov.