Linux Operation
SECTION 2 – File and Directory Permissions:
FILE PERMISSIONS:
. This command may come in handy in the following exercises.
Ensure the permissions on the labfile4 file and the current directory (sudent1) are read and execute, and not write, for group. Set them with the chmod command if necessary. Su - into the student2 account. As the student2 user, display the contents of the labfile4 file using the cat command. Can you do it? .
While still logged into the student2 account, attempt to append a second line of text called “This is the second line of labfile4” to the labfile4 file using the echo >> command. Can you do it? .
Why or why not? .
While still logged into the student2 account, attempt to set write permission for group on the labfile4 file from the student2 account, using a relative path. What command did you enter? .
Can you do it? .
Why or why not? .
Log out of the student2 account and back into the student1 account and change the permissions on the labfile4 file to include write permission for group, leaving the read and execute access on it. What command did you enter to do this? .
Why can student1 change permissions on this file? .
Now su – back into the student2 account. Again attempt to append a second line of text called “This is the second line of labfile4” to student1’s labfile4 file using the echo >> command. Can you do it? .
Why or why not? .
DIRECTORY PERMISSIONS:
.
Using the octal notation for permissions, what are the permissions on this directory file: .
While still in the student1 account, use the echo > command with output redirection, create a file in the subdir2 directory called labfile5 and put the following text in this file: “This is the first line of labfile5”. Ensure the permissions on the subdir2 directory and the subdir2/labdile5 file are read and execute, and not write, for group. Set them with the chmod command if necessary.
Now su – to the student2 account. As the student2 user, ensure you are in your home directory. Display the contents of this labfile5 file using a relative path with the cat command. What command did you use: .
Can you view this file? (you should be able to…) .
Attempt to append a second line of text called “This is the second line of labfile5” to the labfile5 file using the echo command with output redirection. Can you do it? .
Why or why not? .
Log out of the student2 account and back into the student1 account and change the permissions on the subdir2 directory only, to include write permission, leaving the read and execute access on it. What command did you use? .
In the student2 account, again attempt to append a second line of text called “This is the second line of labfile5” to the student1’s labfile5 file using the echo >> command. Can you do it? .
Why or why not? .
Attempt to delete the labfile5 file from student2 account. Can you do it? .
Create a file called labfile6 in the subdir2 directory. Can you do it? .
What three file operations does write permission allow on a directory, even if write is not enabled on files within?
1 .
2 .
3 .
DEFAULT PERMISSIONS (UMASK):
Explain in detail, how the permissions got set this way on this file, in regard to umask. Be Specifc. (Also explain why execute is not set on this file)? .
Create a subdirectory called subdir3. What are the permissions on this directory file, in octal notation?
.
Explain in detail, how the permissions got set this way on this directory in regard to umask. Be Specifc.
.
i could not post answer as its very lengthy so we have limit to post not more than 65,000 characters. so here is the link for the answer
https://www.dropbox.com/s/1fbo3hp6oqku0e6/Answer.docx?dl=0
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)
Get Answers For Free
Most questions answered within 1 hours.