ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 43 - XK0-005 discussion

Report
Export

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?

A.
chown web:web /home/web
Answers
A.
chown web:web /home/web
B.
chmod -R 400 /home/web
Answers
B.
chmod -R 400 /home/web
C.
echo "umask 377" >> /home/web/.bashrc
Answers
C.
echo "umask 377" >> /home/web/.bashrc
D.
setfacl read /home/web
Answers
D.
setfacl read /home/web
Suggested answer: C

Explanation:

The command that will satisfy the requirement of having all files that are created by the user named web have read-only permissions by the owner is echo "umask 377" >> /home/web/.bashrc. This command will append the umask 377 command to the end of the .bashrc file in the web user's home directory. The .bashrc file is a shell script that is executed whenever a new interactive shell session is started by the user. The umask command sets the file mode creation mask, which determines the default permissions for newly created files or directories by subtracting from the maximum permissions (666 for files and 777 for directories). The umask 377 command means that the user does not want to give any permissions to the group or others (3 = 000 in binary), and only wants to give read permission to the owner (7 - 3 = 4 = 100 in binary). Therefore, any new file created by the web user will have read-only permission by the owner (400) and no permission for anyone else. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; Umask Command in Linux | Linuxize

asked 02/10/2024
ABDOUL RAZAK TIENDREBEOGO
26 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first