Problem 7 (12 points): Answer the following questions about the chmod command: a
ID: 3590380 • Letter: P
Question
Problem 7 (12 points): Answer the following questions about the chmod command: a) Numeric notation uses digits to represent the permission bits to be set, whereas symbolic notation uses b) Using symbolic notation, how would you add read and write permission for the group? c) Using symbolic notation, how would you set the permission of the user to be read and write, but no execute? d) Using numeric notation, how would you assign the permission string -rwxr-x--x? e) Using numeric notation, how would you assign the permission string to identify the user type and permissions. -rw- 0 In Linux, if you have a link to a file rather than the actual file, can you change the permissions of the link using chmod? (hint: look up the Linux man page for chmod)?Explanation / Answer
a. Characters
Symbolic notation uses nine characters in three set to represent a class of permissions as three characters. The first set represents the user class. The second set represents the group class. The third set represents the others class. The characters are ‘r’, ‘w’, ans ‘x’.
b. As explained above, the second set represents the group’s permissions. Hence, to set read and write permissions for the group, the following command should be used:
----rw----
Here. ‘r’ stands for read, and ‘w’ for write.
c. The first set represents the user’s permission, so the following command would set the user permissions to read and write, but not execute:
-rw-------
d. The numeric notation uses octal system. So, the given string can be written as follows:
751
Here, 7 means that all permissions are granted to a group.
e. Using the same logic as in part d, the following command is required:
600
Here, 0 means that no permission is granted to that group.
f. In linux, chmod cannot change the permissions of a file if you have only links to it. You should have the permission to access the file for chmod to work.