Which of the following commands should be used to set filename.log permissions to -rwxr―r–. ?
A Linux administrator needs to correct the permissions of a log file on the server.
Which of the following commands should be used to set filename.log permissions to -rwxr―r–. ?
A . chmod 755 filename.log
B . chmod 640 filename.log
C . chmod 740 filename.log
D . chmod 744 filename.log
Answer: A
Explanation:
The command chmod 755 filename.log should be used to set filename.log permissions to -rwxr–r–. The chmod command is a tool for changing file permissions on Linux file systems. The permissions can be specified in octal notation, where each digit represents the permissions for the owner, group, and others respectively.
The permissions are encoded as follows:
0: no permission
1: execute permission
2: write permission
4: read permission
5: read and execute permissions (4 + 1)
6: read and write permissions (4 + 2)
7: read, write, and execute permissions (4 + 2 + 1)
The command chmod 755 filename.log will set the permissions to -rwxr–r–, which means that the owner has read, write, and execute permissions (7), the group has read and execute permissions (5), and others have read and execute permissions (5). This is the correct command to use to accomplish the task. The other options are incorrect because they either set the wrong permissions (chmod 640, chmod 740, or chmod 744) or do not exist (chmod -G).
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, page 345.
Latest XK0-005 Dumps Valid Version with 136 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund