nerdexam
CompTIA

XK0-005 · Question #110200

An administrator changed the default port of an SSH server to 2222 on myhost, and clients are not able to connect. The administrator runs some commands and receives the following output: $ ssh -p…

The correct answer is B. firewall-cmd --zone=public --add-port=2222. The administrator has likely updated the SSH server to listen on a non-standard port (2222), but the firewall rules were not updated to allow connections on this new port. The firewall-cmd command with the --add-port option allows traffic on a specific port through the…

System Management

Question

An administrator changed the default port of an SSH server to 2222 on myhost, and clients are not able to connect. The administrator runs some commands and receives the following output: $ ssh -p 2222 myhost ssh:connect to host myhost on port 2222: No route to host $ ping myhost PING myhost (192.168.0.10) 56(84) bytes of data 64 bytes from myhost (192.168.0.10): icmp_seq=1 time=0.876 ms 64 bytes from myhost (192.168.0.10): icmp_seq=2 time=0.732 ms Which of the following commands should be run on myhost?

Options

  • Afirewall-cmd --zone=public --add-service=ssh
  • Bfirewall-cmd --zone=public --add-port=2222
  • Ciptables --zone=public --add-service=ssh
  • Diptables --zone=public --add-port=2222

How the community answered

(45 responses)
  • A
    9% (4)
  • B
    84% (38)
  • C
    4% (2)
  • D
    2% (1)

Explanation

The administrator has likely updated the SSH server to listen on a non-standard port (2222), but the firewall rules were not updated to allow connections on this new port. The firewall-cmd command with the --add-port option allows traffic on a specific port through the firewall. The command should be executed on myhost to permit incoming SSH connections on port 2222.

Topics

#Firewall configuration#SSH connectivity#Linux command-line#Network troubleshooting

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice