XK0-005 · Question #247
Users in the sales department are unable to create new files in the shared directory /Sales. A junior Linux administrator determines the permissions on the /Sales directory are set to rwxr-----, and…
The correct answer is B. chmod 770 /Sales. To enable users in the 'sales' group to create files within the /Sales directory, the directory's group permissions must be updated to include write access.
Question
Users in the sales department are unable to create new files in the shared directory /Sales. A junior Linux administrator determines the permissions on the /Sales directory are set to rwxr-----, and sales is the group owner of the directory. Which of the following is the BEST command for the junior administrator to issue to allow the users to create new files?
Options
- Aumask 002
- Bchmod 770 /Sales
- Cchmod g+s /Sales
- Dchmod 777 /Sales
How the community answered
(42 responses)- A2% (1)
- B81% (34)
- C10% (4)
- D7% (3)
Why each option
To enable users in the 'sales' group to create files within the `/Sales` directory, the directory's group permissions must be updated to include write access.
`umask 002` sets the default permissions for newly created files and directories for a user, but it does not modify the permissions of an existing directory.
The `chmod 770 /Sales` command changes the directory permissions to `rwxrwx---`. This grants read, write, and execute permissions to the file owner and the group ('sales'), while denying all permissions to others, thereby enabling group members to create new files.
`chmod g+s /Sales` sets the Set Group ID (SGID) bit, causing new files to inherit the directory's group, but it does not grant write permission to the group on the directory itself.
`chmod 777 /Sales` would grant read, write, and execute permissions to all users, which is an unnecessary security risk as only the 'sales' group requires write access.
Concept tested: Linux directory permissions and chmod
Source: https://manpages.debian.org/stable/coreutils/chmod.1.en.html
Topics
Community Discussion
No community discussion yet for this question.