nerdexam
CompTIA

XK0-005 · Question #157

An administrator notices a directory on a web server named /var/www/html/old_reports that should no longer be accessible on the web. Which of the following commands will accomplish this task?

The correct answer is A. chmod 000 /var/www/html/old_reports. chmod 000 removes all read, write, and execute permissions from the owner, group, and others (world). Since the Apache web server process runs as an unprivileged user (e.g., apache or www-data), stripping all permissions means it cannot read or traverse the directory, making…

Security

Question

An administrator notices a directory on a web server named /var/www/html/old_reports that should no longer be accessible on the web. Which of the following commands will accomplish this task?

Options

  • Achmod 000 /var/www/html/old_reports
  • Bchgrp root /var/www/html/old_reports
  • Cchown apache /var/www/html/old_reports
  • Dsetenforce apache /var/www/html/old_reports

How the community answered

(30 responses)
  • A
    70% (21)
  • B
    3% (1)
  • C
    10% (3)
  • D
    17% (5)

Explanation

chmod 000 removes all read, write, and execute permissions from the owner, group, and others (world). Since the Apache web server process runs as an unprivileged user (e.g., apache or www-data), stripping all permissions means it cannot read or traverse the directory, making the contents inaccessible over the web. Option B (chgrp root) only changes the group owner and does not restrict access on its own. Option C (chown apache) grants the web server ownership, which would increase access, not restrict it. Option D (setenforce) is an SELinux command used to toggle enforcing mode, not to set file permissions.

Topics

#File Permissions#chmod#Web Server#Linux Security

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice