Assignment Lab4

CYSE 270: Linux System for Cybersecurity
Assignment: Lab 4

Group and User Accounts

Task A –User Account management (8 * 5 =40 points)

Open a terminal window in VM and execute the correct command to display the user account
information (including the login shell and home directory) for the current user using grep.

2. Execute the correct command to display user password information (including the encrypted
password and password aging) for the current user using grep.

3. Create a new user named xxxxx and explicitly use options to create the home directory/home/
Xxxxx for this user

4. Set a password for the new user.

5. Set bash shell as the default login shell for the new user xxxxx, then verify the change

6. Execute the correct command to display user password information (including the encrypted
password and password aging) for the new user xxxxx using grep.

7. Add the new user xxxxx to the sudo group without overriding the existing group membership

8. Switch to the new user’s account.

Task B– Group account management (12 * 5 =60 points)

Return to your home directory and determine the shell you are using.

Display the current user’s ID and group membership

Display the group membership of the root account.

Run the correct command to determine the user owner and group owner of the /etc/group file

Create a new group named test and use your UIN as the GID.

Display the group account information for the test group using grep

Change the group name of the test group to newtest

8. Add the current account (xxxxx) as a secondary member of the newtest group without overriding this user’s current group membership.

  1. Create a new file testfile in the account’s home directory, then change the group owner to
    newtest

10. Display the user owner and group owner information of the file testfile

11. Delete the newtest group, then repeat the previous step. What do you find?

12. Delete the user xxxxx along with the home directory using a single command

Leave a Reply

Your email address will not be published.