Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  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? ______________
  2. 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? _________________
  3. Which user accounts are set up to use the bash shell? __________________________________
  4. 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.
  5. 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.
  6. Use a text editor to view the /etc/passwd file. How many exist total now? _________________
  7. 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.
  8. Once the file in step 7 is created, use the history -c command to clear your command history.
  9. Make a copy of your /etc/passwd file and make sure to upload it when submitting this assignment on BlackBoard.

Exercise 2-2

  1. 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? ______________
  2. 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? _________________
  3. Which group is set to group ID (gid) 0? ______________________
  4. Which group is set to group ID (gid) 27? ________________________
  5. Type groupadd marketing to create a new group named marketing.
  6. Type groupadd engineering create a new group named engineering.
  7. 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.
  8. Type usermod -a -G marketing user2 to add user2 to the marketing group.
  9. Type id user1 to view which groups user1 belongs to. What groups are listed? _____________________________________________________________________________
  10. Which group is listed as user1s primary group (gid)? ___________________________________
  11. Type usermod -g engineering user1, followed by id user1. Which group is listed as user1s primary group (gid) now? ______________________
  12. Use a text editor to view the /etc/group file. How many exist total now? _________________
  13. 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.
  14. Once the file in step 13 is created, use the history -c command to clear your command history.
  15. Make a copy of your /etc/group file and make sure to upload it when submitting this assignment on BlackBoard.

Exercise 2-3

  1. Assume the identity of user1 by issuing su user1.
  2. What does your shell prompt read? __________________________________________
  3. What happens when you press the up arrow to view your command history, and why? ________________________________________________________________________________________________________________________________________________
  4. Type pico /etc/shadow to open the shadow file and view its contents. What happened, and why? ________________________________________________________________________________________________________________________________________________
  5. Try using sudo to open the file by typing sudo pico /etc/shadow. What happened? ________________________________________________________________________________________________________________________________________________
  6. 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? _________________________
  7. 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.
  8. Lets assume the identity of user1 again by issuing su user1. What does your shell prompt read? __________
  9. Type pico /etc/shadow to open the shadow file and view its contents. What happened, and why? ________________________________________________________________________________________________________________________________________________
  10. Try using sudo to open the file by typing sudo pico /etc/shadow. What happened? _______________________________________________________________________________________________________________________________________________
  11. 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.
  12. 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.
  13. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions