CompTIA Server+ (SK0-005) — Question 203
Joe, a user in the IT department, cannot save changes to a sensitive file on a Linux server. An is -la shows the following listing:
-rw-r--r 1 Ann IT 6780 12 June 2019 filename
Which of the following commands would BEST enable the server technician to allow Joe to have access without granting excessive access to others?
Answer options
- A. chmod 777 filename
- B. chown Joe filename
- C. chmod g+w filename
- D. chgrp IT filename
Correct answer: C
Explanation
The correct answer is C because using 'chmod g+w filename' will add write permission to the group, allowing Joe to modify the file without changing the owner or giving full access to everyone. Option A is incorrect as it grants excessive permissions to all users. Option B changes the ownership to Joe, which may not be necessary and could disrupt access for others. Option D only changes the group but does not grant the required write permission to Joe.