161k views
0 votes
Terry Haslam (thaslam) was dismissed from the organization. His colleagues have harvested the files they need from his home and other directories. Your company security policy states that upon dismissal, users accounts should be removed in their entirety.

In this lab, your task is to:
• Remove the thaslam user account and the home directory from the system. The -r switch removes the home directory when the user is also removed.
• When you're finished, view the /etc/passwd file and /home directory to verify the account's removal.

User Sowdri
by
8.7k points

1 Answer

2 votes

To comply with the security policy, the user account "thaslam" and its home directory were removed using the command `sudo userdel -r thaslam`. Verification was done by checking `/etc/passwd` and `/home` directory for the removal.

To achieve the task described in the lab, you can use the following commands in a Unix/Linux terminal. Ensure that you have the necessary administrative privileges to remove a user account:

# Remove the user account and home directory

sudo userdel -r thaslam

# Verify removal by viewing /etc/passwd

cat /etc/passwd

# Verify removal of home directory

ls /home

Explanation has been given below.

1. `sudo userdel -r thaslam`: This command removes the user account (`thaslam`) and the associated home directory (`-r` switch ensures removal of the home directory).

2. `cat /etc/passwd`: Displays the content of the `/etc/passwd` file, allowing you to verify that the user account has been removed.

3. `ls /home`: Lists the content of the `/home` directory to confirm the removal of the user's home directory.

Make sure to execute these commands with caution, as they involve user account removal and can have significant consequences.

User Rolando Cruz
by
8.2k points