← All RHCSA Flashcard Decks

RHCSA SELinux Contexts and Booleans Flashcards

7 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 RHCSA SELinux Contexts and Booleans flashcards as text
  1. Which command permanently changes the SELinux context of a file so it survives a relabel?

    Answer: semanage fcontext -a -t httpd_sys_content_t '/var/www/html/index.html'

    semanage fcontext writes a persistent policy rule; chcon only sets the label temporarily and it is lost on relabel.

  2. A web server cannot read files copied from /root/docs/ to /var/www/html/. Audit2allow suggests allowing the access. What should you check FIRST?

    Answer: Verify the file context with ls -Z and run restorecon

    Files copied from /root retain the user_home_t context; restorecon resets them to the correct httpd_sys_content_t label before writing any new policy.

  3. What is the effect of running 'touch /.autorelabel' and rebooting?

    Answer: All filesystem objects are relabeled according to the current policy on next boot

    The presence of /.autorelabel triggers a full filesystem relabel during the next boot using the active policy.

  4. Which SELinux boolean allows Apache to connect to a network database like MariaDB?

    Answer: httpd_can_network_connect

    httpd_can_network_connect permits Apache to initiate outbound TCP connections, including to database ports.

  5. You need to allow the FTP daemon to read files in home directories. Which boolean should you enable?

    Answer: ftp_home_dir

    The ftp_home_dir boolean grants vsftpd read access to user home directories under SELinux.

  6. Which command lists all currently active SELinux boolean values along with their descriptions?

    Answer: semanage boolean -l

    semanage boolean -l shows each boolean, its current and default state, and a human-readable description.

  7. A custom application writes logs to /opt/myapp/logs/. After setting the correct SELinux context with semanage fcontext, what command applies the new context to existing files?

    Answer: restorecon -Rv /opt/myapp/logs/

    restorecon -Rv recursively applies the contexts defined in the policy database to existing files, and -v reports changes.

Written and edited by , founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. redhat.com — Test delivery, retake policy, score release, renewal, score validity, exam information · verified Dec 2026