Question
Please answer using linux. 1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the ter- minal using the user name
Please answer using linux.
1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the ter- minal using the user name of root and the password of LNXrocks!.
2. At the command prompt, type touch permsample and press Enter. Next, type chmod 777 permsample at the command prompt and press Enter.
3. At the command prompt, type ls -l and press Enter. Who has permissions to this file? 4. At the command prompt, type chmod 000 permsample and press Enter. Next, type ls l at the command prompt and press Enter. Who has permissions to this file? 5. At the command prompt, type rm f permsample and press Enter. Were you able to delete this file? Why? 6. At the command prompt, type cd / and press Enter. Next, type pwd at the command prompt and press Enter. What directory are you in? Type ls F at the command prompt and press Enter. What directories do you see? 7. At the command prompt, type ls l and press Enter to view the owner, group owner, and permissions on the foruser1 directory created in Hands-on Project 5-1. Who is the owner and group owner? If you were logged in as the user user1, in which category would you be placed (user, group, other)? What permissions do you have as this cate- gory (read, write, execute)? 8. At the command prompt, type cd /foruser1 and press Enter to enter the foruser1 directory. Next, type ls -F at the command prompt and press Enter. Are there any files in this directory? Type cp /etc/hosts . at the command prompt and press Enter. Next, type ls -F at the command prompt and press Enter to ensure that a copy of the hosts file was made in your current directory. 9. Switch to a different command-line terminal (tty3) by pressing Ctrl+Alt+F3 and log in to the terminal using the user name of user1 and the password of LNXrocks!. 10. At the command prompt, type cd /foruser1 and press Enter. Were you successful? Why? Next, type ls -F at the command prompt and press Enter. Were you able to see the contents of the directory? Why? Next, type rm f hosts at the command prompt and press Enter. What error message did you see? Why? 11. Switch back to your previous command-line terminal (tty2) by pressing Ctrl+Alt+F2. Note that you are logged in as the root user on this terminal. 12. At the command prompt, type chmod o+w /foruser1 and press Enter. Were you able to change the permissions on the /foruser1 directory successfully? Why? 13. Switch back to your previous command-line terminal (tty3) by pressing Ctrl+Alt+F3. Note that you are logged in as the user1 user on this terminal. 14. At the command prompt, type cd /foruser1 and press Enter. Next, type rm f hosts at the command prompt and press Enter. Were you successful now? Why? 15. Switch back to your previous command-line terminal (tty2) by pressing Ctrl+Alt+F2. Note that you are logged in as the root user on this terminal
16. At the command prompt, type cd /foruser1 and press Enter to enter the foruser1 directory. Type cp /etc/hosts . at the command prompt and press Enter to place another copy of the hosts file in your current directory. 17. At the command prompt, type ls l and press Enter. Who is the owner and group owner of this file? If you were logged in as the user user1, in which category would you be placed (user, group, other)? What permissions do you have as this category (read, write, execute)? 18. Switch back to your previous command-line terminal (tty3) by pressing Ctrl+Alt+F3. Note that you are logged in as the user1 user on this terminal. 19. At the command prompt, type cd /foruser1 and press Enter to enter the foruser1 directory. Type cat hosts at the command prompt and press Enter. Were you success- ful? Why? Next, type vi hosts at the command prompt to open the hosts file in the vi editor. Delete the first line of this file and save your changes. Were you successful? Why? Exit the vi editor and discard your changes. 20. Switch back to your previous command-line terminal (tty2) by pressing Ctrl+Alt+F2. Note that you are logged in as the root user on this terminal. 21. At the command prompt, type chmod o+w /foruser1/hosts and press Enter. 22. Switch back to your previous command-line terminal (tty3) by pressing Ctrl+Alt+F3. Note that you are logged in as the user1 user on this terminal. 23. At the command prompt, type cd /foruser1 and press Enter to enter the foruser1 directory. Type vi hosts at the command prompt to open the hosts file in the vi edi- tor. Delete the first line of this file and save your changes. Why were you successful this time? Exit the vi editor. 24. At the command prompt, type ls -l and press Enter. Do you have permission to exe- cute the hosts file? Should you make this file executable? Why? Next, type ls l /bin at the command prompt and press Enter, Note how many of these files to which you have execute permission. Type file /bin/* at the command prompt and press Enter to view the file types of the files in the /bin directory. Should these files have the execute permission? 25. Type exit and press Enter to log out of your shell.
26. Switch back to your previous command-line terminal (tty2) by pressing Ctrl+Alt+F2. Note that you are logged in as the root user on this terminal.
27. Type exit and press Enter to log out of your shell.
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