CompTIA Server+ Exam SK0-004: Resolving File Saving Issue in Ann's Home Directory

chmod Command for Fixing File Saving Issue in Ann's Home Directory

Prev Question Next Question

Question

A server administrator receives a report that Ann, a new user, is unable to save a file to her home directory on a server.

The administrator checks Ann's home directory permissions and discovers the following: dr-xr-xr-- /home/Ann Which of the following commands should the administrator use to resolve the issue without granting unnecessary permissions?

A.

chmod 777 /home/Ann B.

chmod 666 /home/Ann C.

chmod 711 /home/Ann D.

chmod 754 /home/Ann.

D.

Reference: https://linuxize.com/post/what-does-chmod-777-mean/

Explanations

A server administrator receives a report that Ann, a new user, is unable to save a file to her home directory on a server.

The administrator checks Ann's home directory permissions and discovers the following: dr-xr-xr-- /home/Ann Which of the following commands should the administrator use to resolve the issue without granting unnecessary permissions?

A.

chmod 777 /home/Ann

B.

chmod 666 /home/Ann

C.

chmod 711 /home/Ann

D.

chmod 754 /home/Ann.

D.

https://linuxize.com/post/what-does-chmod-777-mean/

The command that the administrator should use to resolve the issue without granting unnecessary permissions is D. chmod 754 /home/Ann.

Explanation:

The permissions on Ann's home directory are set to dr-xr-xr--, which means that the owner of the directory (presumably Ann) has read, write, and execute permissions, but other users (including the server administrator) only have read and execute permissions.

To allow Ann to save files to her home directory, the administrator needs to grant write permissions to the directory. However, the administrator should avoid granting unnecessary permissions (such as read or execute permissions to other users), as this could compromise the security of the system.

The chmod command is used to modify file and directory permissions. The syntax of the chmod command is as follows:

chmod [options] mode file/directory

The mode argument specifies the permissions to be set, and can be specified in either numeric or symbolic notation. In this case, we will use symbolic notation.

Symbolic notation uses letters to represent the various permissions. The letters are as follows:

  • r: read permission
  • w: write permission
  • x: execute permission

The letters are combined to form a three-digit code, with the first digit representing the owner's permissions, the second digit representing the group's permissions, and the third digit representing everyone else's permissions.

In this case, we want to grant Ann write permission to her home directory, while keeping the existing permissions for everyone else. The existing permissions are dr-xr-xr--, which corresponds to the numeric code 554. To grant write permission to the owner (Ann), we need to add the w letter to the first digit of the code, giving us 7. To keep the existing permissions for the group and everyone else, we can use the symbolic notation a=rx. This sets the read and execute permissions for all users (owner, group, and everyone else), while removing any existing write permission. Combining these options gives us the command:

chmod 754 /home/Ann

This sets the owner's permissions to read, write, and execute (7), the group's permissions to read and execute (5), and everyone else's permissions to read and execute (4). This allows Ann to save files to her home directory, while keeping the existing permissions for everyone else.