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 of1301
. - Update the name of the
dev
group todevops
.
- Create and Modify Users
- Create a user called
sam
— he should not have a home directory, andqa
anddevops
should be added as supplementary groups. - Create a user called
steve
— the user ID ofsteve
should be1250
, and his main group should beqa
. - Modify the user
john
— change his main group toqa
and make his home directory/home/associate
. - Modify the user
sally
— her user ID should be1255
, andqa
should be added as a supplementary group.
- Create a user called
- Change the Ownership of Files and Directories
- Change the owner and group of
/usr/local/share/staging
and all its contents to besally
andqa
, respectively. - Change the group of
/usr/local/share/production
and all its contents todevops
.
- Change the owner and group of
- 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
.
- Using octal mode permissions, update
- Remove Users and Groups
- Remove the users
benedict
andarnold
. - Remove the group
test
.
- Remove the users