Skip to content

Linux+ XK0-006 practice question 8: Security

A web server process is denied access to a directory that its Unix permissions allow, and the audit log shows an SELinux denial. What is the correct fix?

The options

  • A. Reboot the server and test again.
  • B. Run chmod 777 on the directory.
  • C. Set SELinux to disabled permanently.
  • D. Apply the proper SELinux file context to the directory, for example with semanage fcontext and restorecon.

Answer and why

The correct answer is D: Apply the proper SELinux file context to the directory, for example with semanage fcontext and restorecon.

A. A reboot does not change the file's context.

B. Unix permissions were already fine and 777 does not change the SELinux label.

C. Turning the control off removes protection for the whole system.

D. The label decides access under SELinux, so correcting the context is the targeted fix.

What Security tests

Security is firewalls, SELinux and AppArmor, SSH hardening, auditing and encryption. The best answer is usually the narrowest change that meets the requirement without turning a control off.

Security is 18% of the XK0-006 exam. The exam has 90 questions in 90 minutes, so this question is a slice of the real mix, not a prediction of your result.

Try these next

Each one is a free question from the same practice test, with the answer and the reason for every option on its own page.

Keep going

This is question 8 of 15 in the free Linux+ XK0-006 practice test. If you missed it, say why in one sentence before you read on: the reason is what transfers to a differently worded question.