Linux+ XK0-004 Exam: Setting Permissions on an Application | CompTIA Linux+ Exam Prep

Setting Permissions on an Application

Question

A Linux administrator needs to set permissions on an application with the following parameters: -> The owner of the application should be able to read, write, and execute the application.

-> Members of the group should be able to read and execute the application.

-> Everyone else should not have access to the application.

Which of the following commands would BEST accomplish these tasks?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

The correct answer to the question is C. chmod 750 <application name>.

Here's a detailed explanation of the different components of the command and how they accomplish the given permissions:

  • chmod: This is a Linux command used to change the permissions of a file or directory.
  • 7: This is the permission set for the owner of the file. 7 in binary is 111, which means the owner has read, write, and execute permissions on the file.
  • 5: This is the permission set for the group members of the file. 5 in binary is 101, which means the group members have read and execute permissions on the file.
  • 0: This is the permission set for everyone else. 0 means no permissions.
  • <application name>: This is the name of the file or application whose permissions are being changed.

Putting it all together, chmod 750 <application name> sets the permissions of the file as follows:

  • The owner can read, write, and execute the file (7).
  • Group members can read and execute the file (5).
  • Everyone else has no permissions (0).

This satisfies the given requirements and is therefore the best command for the Linux administrator to use.

Option A, chmod 710 <application name>, only allows the owner to execute the application, which does not meet the requirement for the owner to be able to read, write, and execute the application.

Option B, chmod 730 <application name>, allows the owner to read, write, and execute the application, but also allows group members to write to the application, which is not a requirement.

Option D, chmod 760 <application name>, allows the owner to read, write, and execute the application, but also allows group members to read and write to the application, which is not a requirement.