A company wants to ensure that all newly created files can be modified only by their owners and that all new directory content can be changed only by the creator of the directory.
Which of the following commands will help achieve this task?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
https://www.computerhope.com/unix/uumask.htmThe correct answer to the given question is option B: umask 0012.
Umask is a command in Linux that specifies the default file permission settings for newly created files and directories. It works by subtracting the umask value from the default permission value of the system, resulting in the permission value for newly created files and directories.
The default umask value is usually 0022, which means that new files will have permissions set to 644 (-rw-r--r--) and new directories will have permissions set to 755 (drwxr-xr-x). This means that any user can read the files, but only the owner can modify them. Similarly, any user can list the contents of the directory, but only the owner can create or delete files within it.
In order to achieve the desired permissions, the umask value needs to be changed so that newly created files and directories have more restrictive permissions. Option B, umask 0012, will set the umask value to 0012, which means that new files will have permissions set to 644 (-rw-r--r-x) and new directories will have permissions set to 753 (drwxr-x-wx). This means that any user can read the files, but only the owner can modify or execute them. Similarly, any user can list the contents of the directory, but only the owner can create or delete files within it.
Option A, umask 0022, is the default umask value and will not achieve the desired permissions.
Options C and D, chmod "R 0644 /" and chmod "R 0755 /", are commands to change the permissions of existing files and directories, and will not affect the default permissions of newly created files and directories.
Therefore, option B, umask 0012, is the correct answer to achieve the desired permissions for newly created files and directories.