CompTIA Server+ (SK0-005) — Question 100

An administrator discovers a Bash script file has the following permissions set in octal notation:

777

Which of the following is the MOST appropriate command to ensure only the root user can modify and execute the script?

Answer options

Correct answer: A

Explanation

The command 'chmod go-rwx' removes read, write, and execute permissions for group and others, leaving only the root user with access. The option 'chmod u=rwx' sets permissions for the user but does not affect group or others, thus failing to restrict access. 'chmod u+wx' adds write and execute permissions for the user, which does not limit access as required. Lastly, 'chmod g-rwx' only removes permissions for the group, leaving others unaffected.