CompTIA Linux+ (XK0-004) — Question 119
A new HTTPS web service is being deployed on a server. Which of the following commands should the Linux administrator use to ensure traffic is able to flow through the system firewall to the new service?
Answer options
- A. iptables ג€"I OUTPUT ג€"p tcp --sport 443 ג€"j ACCEPT
- B. iptables ג€"A INPUT ג€"p tcp --dport 443 ג€"j ACCEPT
- C. iptables ג€"I INPUT --dport 443 ג€"j ACCEPT
- D. iptables ג€"A OUTPUT ג€"p tcp --dport 443 ג€"j ACCEPT
Correct answer: C
Explanation
The correct answer is C, as it inserts a rule into the INPUT chain to accept incoming TCP traffic on port 443, which is essential for HTTPS communication. Option A modifies the OUTPUT chain, which is not needed for incoming traffic. Option B appends a rule to the INPUT chain but does not specify the insertion position, which is less optimal. Option D affects the OUTPUT chain, allowing outgoing connections rather than incoming ones.