Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 3: Permissions for files Follow the instructions step by step and finish the questions as required. 1) Go into your Lab3 directory. 2) Check
Part 3: Permissions for files Follow the instructions step by step and finish the questions as required. 1) Go into your Lab3 directory. 2) Check the file permissions for file "Try.c" in your own Lab3 directory. 3) You may see similar output as below, in which rw-rw-r-- of the first field is the file permission string for "Try.c". [ylong4@gsuad.gsu.edu@snowball Lab3] $ ls -1 Try.c -rw-rw-r--, 1 ylong4@gsuad.gsu.edu ylong4@gsuad.gsu.edu 379 Sep 11 19:09 Try.c The leftmost 3 characters rw- tells us that the user (owner of the file) can only read and write the file. The middle 3 characters rw- tells us the other users in the same group as the owner can only read and write the file. The last 3 characters r-- tells us the other users in the other groups different from owner can only read the file. Note: once you copy a file from other directory or download a file from other resources, you are the owner of the new copied or downloaded file. 4) Remove the read permission for the owner (yourself). 5) Check the file permissions for file "Try.c" again. 6) You may see similar output as below, in which -w-rw-r-- of the first field is the file permission string for "Try.c". [ylong4@gsuad.gsu.edu@snowball Lab3] $ ls -1 Try.c --w-rw-r--, 1 ylong4@gsuad.gsu.edu ylong4@gsuad.gsu.edu 379 Sep 11 19:11 Try.c So -w- in the leftmost 3 characters tells us that the user (owner of the file ) only has the permission to write something into the file. 7) Try the vi editor again to modify the file. 8) However, you may find following message displayed at the bottom of the screen which means you do not have the right to read "Try.c". 0,0-1 All "Try.c" [Permission Denied] 9) Quit vi editor. 10) Try read "Try.c" again using cat. Attach a screenshot of the output. 11) Use chmod with an octal number to let all the users only have read permission for "Try.c". 12) Check the file permissions for file "Try.c" again. And explain the meaning of each character in the file permission string. 13) Try the vi editor again to modify the file. Then remove one line by pressing dd 14) Try to save the file in the vi editor. 15) Can you find some error message at the bottom of the screen? If yes, what is it and how to quit the vi editor without saving the modification. 16) Use chmod to add write the permission to all the users for "Try.c". 17) Check the file permissions for file "Try.c" again. And explain the meaning of each character in the file permission string
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