ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 152 - XK0-005 discussion

Report
Export

A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?

A.
chmod 775
Answers
A.
chmod 775
B.
umask. 002
Answers
B.
umask. 002
C.
chactr -Rv
Answers
C.
chactr -Rv
D.
chown -cf
Answers
D.
chown -cf
Suggested answer: B

Explanation:

The command umask 002 will accomplish the task of reconfiguring the server so that only file owners and group members can modify new files by default. The umask command is a tool for setting the default permissions for new files and directories on Linux systems. The umask value is a four-digit octal number that represents the permissions that are subtracted from the default permissions. The default permissions for files are 666, which means read and write for owner, group, and others. The default permissions for directories are 777, which means read, write, and execute for owner, group, and others. The umask value consists of four digits: the first digit is for special permissions, such as setuid, setgid, and sticky bit; the second digit is for the owner permissions; the third digit is for the group permissions; and the fourth digit is for the others permissions. The umask value can be calculated by subtracting the desired permissions from the default permissions. For example, if the desired permissions for files are 664, which means read and write for owner and group, and read for others, then the umask value is 002, which is 666 - 664. The command umask 002 will set the umask value to 002, which will ensure that only file owners and group members can modify new files by default. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not set the default permissions for new files (chmod 775 or chown -cf) or do not exist (chattr -Rv). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11:

Managing File Permissions and Ownership, page 349.

asked 02/10/2024
Mohammed Meddah
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first