Just as you need to be able to add accounts to the system, it is also useful to be able to remove accounts that are no longer needed on the system. Debian provides the program userdel to remove a user account from /etc/passwd. With the -r option, userdel will also remove the home directory for the account and all its contents. So, to remove fred from the system and all the files from /home/fred use the command:
userdel -r fred
The entry in /etc/group is not removed, and neither are any files on the system that are owned by the removed account. When the uid gets reassigned to another account, that account will end up owning those files. They should be removed by hand, or have their ownership changed, which will be described later in this chapter. Removing the entry from /etc/group will require root privilege and the editor of your choice. Simply remove the line containing the account name, in this case fred.