Question
Lab 3 Managing Linux Permissions Complete the following exercises, making sure to follow the instructions carefully. Dont forget to put your name in the top
Lab 3 Managing Linux Permissions
Complete the following exercises, making sure to follow the instructions carefully. Dont forget to put your name in the top right-hand corner of this document and rename the file to Lab3-Lastname, using your last name instead of lastname, before submitting via Blackboard.
Exercise 2-1
- Navigate to the /etc folder using cd and issue an ls -l to see the permissions on the /etc/passwd file. What is the numeric representation of these permissions? ______________
- Use a text editor to view the /etc/passwd file. Note that there is a line for each user that exists on your operating system. How many exist total? _________________
- Which user accounts are set up to use the bash shell? __________________________________
- Type adduser user1 to create a new user named user1. Follow the prompts that follow to set a password for the user and set their full name to Rick Deckard. You can leave the other prompts blank.
- Type adduser user2 to create a new user named user2. Follow the prompts that follow to set a password for the user and set their full name to Reginald Linux. You can leave the other prompts blank.
- Use a text editor to view the /etc/passwd file. How many exist total now? _________________
- Issue the command history | cat >> lastname3-1, using your last name instead of lastname. Make sure to upload this file when submitting this assignment on BlackBoard.
- Once the file in step 7 is created, use the history -c command to clear your command history.
- Make a copy of your /etc/passwd file and make sure to upload it when submitting this assignment on BlackBoard.
Exercise 2-2
- Navigate to the /etc folder using cd and issue an ls -l to see the permissions on the /etc/group file. What is the numeric representation of these permissions? ______________
- Use a text editor to view the /etc/group file. Note that there is a line for each group that exists on your operating system. How many exist total? _________________
- Which group is set to group ID (gid) 0? ______________________
- Which group is set to group ID (gid) 27? ________________________
- Type groupadd marketing to create a new group named marketing.
- Type groupadd engineering create a new group named engineering.
- Type usermod -a -G engineering user1 to add user1 to the engineering group. The usermod command modifies the user account specified as an argument at the end (in this case, user1). The -a option indicates that we are adding the user to group, while -G engineering means that we are adding the user to the engineering group.
- Type usermod -a -G marketing user2 to add user2 to the marketing group.
- Type id user1 to view which groups user1 belongs to. What groups are listed? _____________________________________________________________________________
- Which group is listed as user1s primary group (gid)? ___________________________________
- Type usermod -g engineering user1, followed by id user1. Which group is listed as user1s primary group (gid) now? ______________________
- Use a text editor to view the /etc/group file. How many exist total now? _________________
- Issue the command history | cat >> lastname3-2, using your last name instead of lastname. Make sure to upload this file when submitting this assignment on BlackBoard.
- Once the file in step 13 is created, use the history -c command to clear your command history.
- Make a copy of your /etc/group file and make sure to upload it when submitting this assignment on BlackBoard.
Exercise 2-3
- Assume the identity of user1 by issuing su user1.
- What does your shell prompt read? __________________________________________
- What happens when you press the up arrow to view your command history, and why? ________________________________________________________________________________________________________________________________________________
- Type pico /etc/shadow to open the shadow file and view its contents. What happened, and why? ________________________________________________________________________________________________________________________________________________
- Try using sudo to open the file by typing sudo pico /etc/shadow. What happened? ________________________________________________________________________________________________________________________________________________
- We need to set up the user1 account as an account with the ability to invoke sudo. To do this, we have to go back to our root account. Issue the exit command. What does the shell prompt read now? _________________________
- Now that you have verified that you are logged in as root, issue the following command: usermod -a -G sudo user1. The result is that user1 now belongs to the sudo group, meaning they can use sudo when logged in.
- Lets assume the identity of user1 again by issuing su user1. What does your shell prompt read? __________
- Type pico /etc/shadow to open the shadow file and view its contents. What happened, and why? ________________________________________________________________________________________________________________________________________________
- Try using sudo to open the file by typing sudo pico /etc/shadow. What happened? _______________________________________________________________________________________________________________________________________________
- Issue the command history | cat >> lastname3-3b, using your last name instead of lastname. Make sure to upload this file when submitting this assignment on BlackBoard.
- Type exit to return to the root account and issue the command history | cat >> lastname3-3a, using your last name instead of lastname. Make sure to upload this file when submitting this assignment on BlackBoard.
- Make a copy of your /etc/shadow file and make sure to upload it when submitting this assignment on BlackBoard.
Exercise 2-4
Provide the numeric representation for permissions on the following files:
/dev/null _______
/dev/tty0 _______
/etc/netconfig _______
/proc/uptime _______
/sbin/apache2 _______
Exercise 2-5
Find and provide the path to a file that matches each of the following type designations:
Regular file (-) ____________________________________
Directory (d) ____________________________________
Symbolic link (l) ____________________________________
Character special file (c) ____________________________________
Block special file (b) ____________________________________
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started