Blocking SSH Connections to 192.168.10.24 with Linux Firewall | XK0-004 Exam | CompTIA Linux+

Blocking SSH Connections to 192.168.10.24

Question

An administrator is attempting to block SSH connections to 192.168.10.24 using the Linux firewall.

After implementing a rule, a connection refused error is displayed when attempting to SSH to 192.168.10.24

Which of the following rules was MOST likely implemented?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

https://www.golinuxhub.com/2014/03/how-to-allowblock-ssh-connection-from.html

The most likely rule that was implemented to block SSH connections to 192.168.10.24 using the Linux firewall is Option B:

css
iptables -A INPUT -p tcp -d 192.168.10.24 --dport 22 -j DROP

Here is a breakdown of the rule:

  • iptables: This is the command used to configure the Linux firewall.
  • -A INPUT: This specifies that the rule is to be added to the INPUT chain, which controls incoming traffic.
  • -p tcp: This specifies that the rule applies to TCP traffic.
  • -d 192.168.10.24: This specifies the destination IP address that the rule applies to.
  • --dport 22: This specifies that the rule applies to traffic on port 22, which is the default port for SSH.
  • -j DROP: This specifies that any traffic matching the rule should be dropped, effectively blocking the SSH connection.

Option A, C, and D are incorrect because they use non-existent j target arguments.

  • Option A: -j REJECT target would send a "connection refused" message to the client indicating that the destination is reachable but the connection is not allowed, which is not what is described in the question.
  • Option C: -j FORWARD target would allow packets to be forwarded to other network interfaces, which is not what is required to block SSH connections to the specified IP.
  • Option D: -j REFUSE is not a valid target for iptables.

Overall, the most likely rule that was implemented is Option B, which drops all incoming TCP traffic on port 22 to the specified IP, effectively blocking SSH connections.