Problem

In this hands-on project, you use the su and sudo utilities to gain root access to your...

In this hands-on project, you use the su and sudo utilities to gain root access to your system.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type useradd dailyuser and press Enter.

3. At the command prompt, type passwd dailyuser and press Enter. Supply the password secret when prompted both times.

4. At the command prompt, type su - dailyuser and press Enter. Were you required to enter a password? At the command prompt, type whoami and press Enter to ensure that you are now logged in as the user dailyuser.

5. At the command prompt, type su - root and press Enter. Enter the root password of secret when prompted. At the command prompt, type whoami and press Enter to ensure that you are now logged in as the user root.

6. Type exit at the command prompt and press Enter to end your root session.

7. Type exit at the command prompt and press Enter to end your dailyuser session.

8. Run the command vi /etc/sudoers. Add the following line to the end of the file: dailyuser server1 = (root) /bin/touch When finished, save your changes (you must use :w!) and quit the vi editor.

9. At the command prompt, type su - dailyuser and press Enter.

10. At the command prompt, type touch /testfile and press Enter. Were you able to create a file under the / directory?

11. At the command prompt, type sudo touch /testfile and press Enter, then enter the password secret when prompted. Were you able to create a file under the / directory?

12. At the command prompt, type ls –l /testfile and press Enter. Who is the owner and group owner for this file? Why?

13. Type exit and press Enter to end your dailyuser session.

14. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search