CompTIA Linux+ XK0-005 Practice Question
Which command should be used to verify that the rules currently loaded into the kernel's packet filter are allowing inbound SSH traffic on port 22?
nmap -p 22 localhost
netstat -tuln
iptables -L
ifconfig
Which command should be used to verify that the rules currently loaded into the kernel's packet filter are allowing inbound SSH traffic on port 22?
nmap -p 22 localhost
netstat -tuln
iptables -L
ifconfig
The correct answer is iptables -L
, which lists all current firewall rules set by iptables, including those that pertain to the default port for SSH traffic (port 22). It's important to inspect these rules when SSH traffic is being blocked, as a misconfigured or overly restrictive rule might prevent inbound connections. ifconfig
is used for configuring network interfaces, not for checking firewall rules. The netstat
command is used to display network connections, listening ports, and routing tables, but it doesn’t provide information about firewall rules. nmap
is a network scanner and while it can show which ports are open, it does not display actual firewall rules.
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Join premium for unlimited access and more features
All plans include the following perks.
Our pricing is simple. Full access to all certifications and exams, for one price.
As many practice tests for as many topics as you want.
Use study mode non-stop, no limits.
No annoying ads and popups. Study without distractions.
Track your scores over time in study mode and report cards.
See how you improve over time, and where you need to focus.
Access our store with even more discounts than before.
Unlimited access to all PBQs and be prepared for the real thing.
Create an account or sign in to access our study materials.