Answered step by step
Verified Expert Solution
Link Copied!

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 /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 LINUXrocks!.
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. Why did you receive an error message?
11
Switch back to your previous command-line terminal (tty5) by pressing Ctrl+Alt+F5. Note that you are logged in as the root user on this terminal and within the /foruser1 directory.
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 and within the /foruser1 directory.
14
At the command prompt, 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 (tty5) by pressing Ctrl+Alt+F5. Note that you are logged in as the root user on this terminal.
16
At the command prompt, type cp /etc/hosts . at the command prompt and press Enter to place another copy of the hosts file in your current directory (/foruser1).
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 does user1 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 and in the /foruser1 directory.
19
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.
20
Switch back to your previous command-line terminal (tty5) by pressing Ctrl+Alt+F5. Note that you are logged in as the root user on this terminal and in the /foruser1 directory.
21
At the command prompt, type chmod o+w 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 and in the /foruser1 directory.
23
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.
24
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 /usr/bin at the command prompt and press Enter. Note how many of these files to which you have execute permission. Type file /usr/bin/*| 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

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions