A Linux administrator is troubleshooting a connection issue. A remote user is unable to connect to an SSH server running on port 22. The administrator confirms the sshd service is active and listening, and basic network connectivity exists (ICMP replies are successful). The server uses the legacy iptables firewall. Which command should the administrator run NEXT to inspect the active packet filtering rules and identify if the firewall is blocking the connection?
The correct command is iptables -L. In this scenario, since the SSH service is confirmed to be running and listening, and basic network pings are successful, the next logical step is to investigate the firewall. The iptables -L command lists all the rules in all chains, allowing an administrator to verify if there is a rule that is dropping or rejecting inbound traffic on TCP port 22. The command netstat -tlpn is used to check for listening ports, but the scenario already states this has been confirmed. systemctl status sshd would show the status of the SSH service, which is also already known. firewall-cmd --list-all is the command used for the firewalld service, not the iptables service specified in the scenario.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is iptables and why is it used?
Open an interactive chat with Bash
How does iptables -L help in checking SSH traffic?
Open an interactive chat with Bash
What is the difference between iptables and nmap when verifying SSH connectivity?