Managing Users, Groups, and Permissions

15 minutes
  • 5 Learning Objectives

About this Hands-on Lab

The ability to modify ownership and permissions is essential for both collaboration and security. In this lab, you will be tasked with creating new users and groups, modifying existing users and groups, updating ownership and permissions on files and directories, and removing unwanted users and groups.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create and Modify Groups
  • Assume the root user (this account will be used to perform all subsequent tasks).
  • Create a group called qa with a group ID of 1301.
  • Update the name of the dev group to devops.
Create and Modify Users
  • Create a user called sam — he should not have a home directory, and qa and devops should be added as supplementary groups.
  • Create a user called steve — the user ID of steve should be 1250, and his main group should be qa.
  • Modify the user john — change his main group to qa and make his home directory /home/associate.
  • Modify the user sally — her user ID should be 1255, and qashould be added as a supplementary group.
Change the Ownership of Files and Directories
  • Change the owner and group of /usr/local/share/staging and all its contents to be sally and qa, respectively.
  • Change the group of /usr/local/share/production and all its contents to devops.
Change the Permissions of Files and Directories
  • Using octal mode permissions, update /usr/local/share/staging to have read/write/execute for owner, read/write/execute for group, and read/execute for other.
  • Using symbolic mode permissions, update /usr/local/share/production to have read/write/execute for owner, read/write/execute for group, and 0 permissions for other.
  • Using octal permissions, update /usr/local/share/production/deploy.sh to have read/write/execute on user, read on group, and 0 permissions for other.
  • Using symbolic mode permissions, add write and execute permissions for the group on /usr/local/share/staging/report.sh.
Remove Users and Groups
  • Remove the users benedict and arnold.
  • Remove the group test.

Additional Resources

Note:

  • All tasks should be performed as the root user.
  • The root user can be accessed by running sudo -i (no password is required)

You work as a Linux administrator for a small IT company, and have been tasked with setting up a server to provide collaboration between the various departments involved in the development and, ultimately, the deployment of the product (please pay close attention to the Note section).

First, you will need to create a new group in charge of quality assurance, named qa with a group ID of 1301, and rename the existing group, dev, to the name devops. Once created, you will need to add two new users — sam and steve. sam should be created without a home directory and with qa and devops as supplementary groups. steve should be created with a user ID of 1250 and his main group should be qa. Then, you will need to update two existing users — john and sally. john's main group should be updated to qa and his home directory should be /home/associate. sally's user ID should be updated to 1255 and qa should be added as a supplementary group.

Now that the users have been added and updated, changes need to be made to the team folders. The folder /usr/local/share/staging/ and all its contents should be owned by sally and the qa group, and the folder /usr/local/share/production/ and its contents should be owned by the devops group.

Next, the folders and their contents need to be updated to provide appropriate access and security. Using octal mode permissions, update /usr/local/share/staging to read/write/execute for owner, read/write/execute for group, and read/execute for other; and update /usr/local/share/production/deploy.sh to have read/write/execute on user, read on group, and 0 permissions for other. Then, using symbolic mode permissions, update /usr/local/share/production/ to read/write/execute for owner, read/write/execute for group, and 0 permissions for other; and add write and execute permissions for group to /usr/local/share/staging/report.sh.

Finally, you will need to remove two users who are no longer with company —benedict and arnold— as well as a group that is no longer in use, test.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?