ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 244 - XK0-005 discussion

Report
Export

A Linux engineer needs to block an incoming connection from the IP address 2.2.2.2 to a secure shell server and ensure the originating IP address receives a response that a firewall is blocking the connection. Which of the following commands can be used to accomplish this task?

A.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j DROP
Answers
A.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j DROP
B.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j RETURN
Answers
B.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j RETURN
C.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j REJECT
Answers
C.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j REJECT
D.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j QUEUE
Answers
D.
iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j QUEUE
Suggested answer: C

Explanation:

The REJECT target sends back an error packet to the source IP address, indicating that the connection is refused by the firewall. This is different from the DROP target, which silently discards the packet without any response. The RETURN target returns to the previous chain, which may or may not accept the connection. The QUEUE target passes the packet to a userspace application for further processing, which is not the desired outcome in this case.

Reference

CompTIA Linux+ (XK0-005) Certification Study Guide, page 316

iptables - ssh - access from specific ip only - Server Fault, answer by Eugene Ionichev

asked 02/10/2024
Mehdi BELGAS
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first