Two specific users need access to a directory owned by root where backups are located.
Which of the following commands would BEST ensure the specified users can access the backup files?
Click on the arrows to vote for the correct answer
A. B. C. D.D.
To grant access to a directory owned by root to specific users, the appropriate command to use is chmod
.
Option A: umask
is not used for granting access to specific users. Instead, it is used to set default file permissions when new files are created.
Option B: chcon
is used to change the SELinux context of files or directories. It is not relevant to granting access to specific users.
Option C: chmod
is the correct command to use for granting access to specific users. chmod
changes the permissions of files or directories. The permissions are divided into three categories: user, group, and others. Each category can be granted read, write, or execute permissions. The syntax for granting access to specific users is:
phpchmod <permissions> <directory>
The <permissions>
field should include the appropriate permissions for the user, group, and others. For example, to grant read, write, and execute permissions to the owner, read and execute permissions to the group, and no permissions to others, the permissions would be set to 700
:
bashchmod 700 /path/to/directory
Option D: setfacl
is used to set access control lists (ACLs) for files or directories. ACLs allow more fine-grained control over file permissions than traditional Unix permissions. However, they are not commonly used and are not necessary in this situation.
In summary, the correct answer is C. chmod
is the command to use for granting access to specific users.