ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 158 - XK0-005 discussion

Report
Export

Which of the following commands is used to configure the default permissions for new files?

A.
setenforce
Answers
A.
setenforce
B.
sudo
Answers
B.
sudo
C.
umask
Answers
C.
umask
D.
chmod
Answers
D.
chmod
Suggested answer: C

Explanation:

The command that is used to configure the default permissions for new files is umask.

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. The command that is used to configure the default permissions for new files is umask. This is the correct answer to the question. The other options are incorrect because they either do not set the default permissions for new files (setenforce, sudo, or chmod) or do not exist (kill -HUP or kill -TERM). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, page 349.

asked 02/10/2024
Gopakumar Nair
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first