Answered step by step
Verified Expert Solution
Question
1 Approved Answer
At the command prompt, type cd / foruser 1 and press Enter to enter the foruser 1 directory. Next, type ls - F at the
At the command prompt, type cd foruser and press Enter to enter the foruser directory. Next, type ls F at the command prompt and press Enter. Are there any files in this directory? Type cp etchosts 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.
Switch to a different commandline terminal tty by pressing CtrlAltF and log in to the terminal using the user name of user and the password of LINUXrocks!.
At the command prompt, type cd foruser 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. Why did you receive an error message?
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the root user on this terminal and within the foruser directory.
At the command prompt, type chmod ow foruser and press Enter. Were you able to change the permissions on the foruser directory successfully? Why?
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the user user on this terminal and within the foruser directory.
At the command prompt, type rm f hosts at the command prompt and press Enter. Were you successful now? Why?
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the root user on this terminal.
At the command prompt, type cp etchosts at the command prompt and press Enter to place another copy of the hosts file in your current directory foruser
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 user in which category would you be placed user group, other What permissions does user have as this category read write, execute
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the user user on this terminal and in the foruser directory.
At the command prompt, type cat hosts at the command prompt and press Enter. Were you successful? 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.
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the root user on this terminal and in the foruser directory.
At the command prompt, type chmod ow hosts and press Enter.
Switch back to your previous commandline terminal tty by pressing CtrlAltF Note that you are logged in as the user user on this terminal and in the foruser directory.
At the command prompt, 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. Why were you successful this time? Exit the vi editor.
At the command prompt, type ls l and press Enter. Do you have permission to execute the hosts file? Should you make this file executable? Why? Next, type ls l usrbin at the command prompt and press Enter. Note how many of these files to which you have execute permission. Type file usrbin more 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?
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