In this week, we will again use our virtual machine. This time, we will be creating two users and granting selected permissions from one user to the other.
First, create a new user with “useradd -m
Next, we will create a group for our users with “groupadd
Test out logging in as your first user with the command “su –
- echo “first file” > file1
- echo “second file” > file2
- echo “third file” > file3
You can validate the contents of file1 with “cat file1”. Let’s validate the file permissions of our files with “ls -l”. Take a screenshot of the output. Every file has nine permissions, ignoring the first one. The first three are for the user, the next three are for the group, and the final three are for others.
Next, we are going to adjust permissions so that:
- File1 is only readable and writeable to user1
- File2 is readable and writeable to user1 and members of the group to which you added both users
- File3 is readable by all users, but writeable only by user1
To make these changes, you’ll use the “chmod” command to adjust permissions, and you’ll need to add file2 to the group our users are in using “chown :
The format is going to be “chmod
Then, switch to the second user account and verify the permissions using the following commands.
- cat file1
- cat file2
- cat file3
- echo “first file” > file1
- echo “second file” > file2
- echo “third file” > file3
Take a screenshot of the results of these commands. If the results don’t match expectations, you can switch back to your user1 and adjust permissions again to get it right.
In your submission, include:
- Screenshot of “ls -l” output before changing permissions
- Screenshot of “ls -l” output after changing permissions
- Screenshot of the validation commands as user2
Parameters
- The assignment should be double-spaced, 12-point Times New Roman font, with one-inch margins
- Use APA for citing references and quotations
- See the assignment rubric below for more details