Question

In: Computer Science

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.)

Project 4-7 In this hands-on project, you apply and modify access permissions on files and directories and test their effects.

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 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 category (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 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 (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 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 /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.

Solutions

Expert Solution

4)
chmod is used to change the permission of a file/directory.chmod 000 is a chmod octal notation.
here 000 means no permissions to anybody ,that means no body can access the file permsample.

5)
rm command is used to remove files/directories from the file system.actually rm is used to removes references to object from the file system.
-f option in rm command is used to forcefully removal of the file/directory.so rm -f permsample command will delete the file succesfully.

6)
cd command is used to change the directory .here we first enter $cd / .so cd / command is used to change directory to the root directory.it is the first directory in the file system hierarchy.
pwd command is used to print the present working directory.since we changed to root directory using cd / command .pwd command prints that we are in / directory (ie., root directory).
ls command is used to listing all the files/directories of present file .-F option with ls ,ie.,$ls -F is used to classifies the file with different special character for diffefrent kind of files.
ex:
/ represents directory
@ represnts link file
* represents executable file
if no special character is there then it is normal file.

7)
when we use $ls -l command all the list of the files with full descriptions are displayed.
there are sevend fields for shown for each directory/file
field1 is about File Permissions,field2 is number of links,field3 is about owner,field4 is about group,field5 is size,field6 is about the last modified date and time,field7 is the file name.
if user1 is added to a group then we will come under group ,if user1 is not assigned to any group then he will come under other.


Related Solutions

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-6 In this hands-on project, you properly shut down your Linux system. 1. Press CtrlþAltþF2 to switch to a command-line terminal (tty2), and then log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type poweroff to shut down your Linux system immediately. Which commands from Table...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-3 In this hands-on project, you log in to a graphical terminal in Fedora Linux and interact with the GNOME and KDE desktops. 1. Switch to the graphical terminal (tty1) by pressing CtrlþAltþF1, click user1, supply the password of LNXrocks!, and click Sign In. Which desktop is started and why? 2. The first time you log into the...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-5 In this hands-on project, you find information about commands using help utilities. 1. Press CtrlþAltþF2 to switch to a command-line terminal (tty2), and then log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type man –k cron and press Enter to view a list of...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-4 In this hands-on project, you use and protect shell metacharacters. 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 LNXrocks!. 2. At the command prompt, type date;who and press Enter to run the date command immediately followed by the who...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-2 In this hands-on project, you explore some command-line terminals on a Linux system and enter some basic commands into the BASH shell. 1. After your Linux system has been loaded, you are placed at a graphical terminal (tty1). Instead of logging in to this graphical terminal, press CtrlþAltþF2 to switch to a command-line terminal (tty2) and then...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 4-6 In this hands-on project, you delete files and directories using the rmdir and rm commands. 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 LNXrocks!. 2. At the command prompt, type cd samples and press Enter. At the command prompt,...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it on mac and please...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it on mac and please add photos of the virtual machine.) Project 4-11 In this hands-on project, you configure and research filesystem attributes. 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 LNXrocks!. 2. At the command prompt, type touch toughfile and press Enter. Next, type lsattr toughfile at the command prompt...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that you work for a company that is developing a telephone database and you are creating directories for the Mail and Receiving Departments, which are referenced in the company’s budget and accounting systems as departments 4540 and 4550. After you create the directories, you begin creating files of department phone numbers to store in those directories. You must use the mkdir (make directory) command to...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to perform basic transformations on text read from a file or a pipe. The result is sent to standard output. The syntax for the sed command has no output file specification, but results can be saved to a file using output redirection. The editor does not modify the original input. What distinguishes sed from other editors, such as vi and ed, is its ability to...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management course material as a guide and the Earned Value (EV) formulas described in the example problem, answer the questions below by showing your calculations and solutions for each project parameter. Our 6-month project example is described as follows: Total Hours of Work:  1,100 Hours Cost per Hour:  $185 per hour Project cost at end of month three: $110,000 Estimated work complete at end of month three:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT