exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 129 discussion

Actual exam question from CompTIA's XK0-005
Question #: 129
Topic #: 1
[All XK0-005 Questions]

A Linux user reported the following error after trying to connect to the system remotely: ssh: connect to host 10.0.1.10 port 22: Resource temporarily unavailable
The Linux systems administrator executed the following commands in the Linux system while trying to diagnose this issue:

Which of the following commands will resolve this issue?

  • A. firewall-cmd --zone=public --permanent --add-service=22
  • B. systemctl enable firewalld; systemctl restart firewalld
  • C. firewall-cmd --zone=public --permanent --add-service=ssh
  • D. firewall-cmd --zone=public --permanent --add-port=22/udp
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Qubert2
6 months, 3 weeks ago
C but it won't work until the firewall is reloaded with: firewall-cmd --reload
upvoted 1 times
...
linux_admin
2 years, 3 months ago
Selected Answer: C
The command firewall-cmd --zone=public --permanent --add-service=ssh is used to add the SSH service to the list of allowed services in the firewall configuration of a Linux system. Here is a breakdown of the command: firewall-cmd is the command-line tool used to manage the firewall configuration in a Linux system that uses the firewalld firewall daemon. --zone=public specifies the firewall zone to which the rule should be applied. The public zone is one of the predefined zones in firewalld that is typically used for public-facing network interfaces. --permanent specifies that the rule should be made persistent across firewall reloads or system reboots. --add-service=ssh specifies that the ssh service should be allowed in the firewall configuration. The ssh service is a predefined service in firewalld that allows incoming SSH traffic on port 22.
upvoted 3 times
linux_admin
2 years, 3 months ago
When the command is executed, the firewall configuration is updated to allow incoming SSH traffic on port 22 for the public zone, and the configuration change is made persistent across firewall reloads or system reboots. This allows SSH connections to be established with the system from remote hosts, provided that the SSH service is running on the system and the SSH port is not blocked by any other firewall or security measure.
upvoted 3 times
...
...
Nvoid
2 years, 5 months ago
Selected Answer: C
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-working_with_zones
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago