Question 181 · 300 in bank
A systems administrator requires that all files that are created by the user named web have read-only permissions by the owner. Which of the following commands will satisfy this requirement?
Show answer
Answer: C
Explanation
The correct answer is C. The "echo "umask 377" >> /home/web/.bashrc" command will satisfy the requirement by adding the umask setting to the user's .bashrc file. The umask setting determines the default file permissions for newly created files and directories. The value of 377 sets the default permissions to read-only for the owner of the file. The umask is specified in octal notation, and each digit represents the permissions for a different category of users. In this case, the first digit represents the permissions for the owner of the file, the second digit represents the permissions for the group owner of the file, and the third digit represents the permissions for others. A value of 3 means that the owner has read and write permissions, and a value of 7 means that the owner has read, write, and execute permissions. By setting the umask to 377, the owner of newly created files will have read-only permissions, the group owner will have no permissions, and others will have no permissions.
Source: Adapted from community discussion — linux_admin
