nerdexam
CompTIA

XK0-005 · Question #579

A systems administrator wants to permit access temporarily to an application running on port 1234/TCP on a Linux server. Which of the following commands will permit this traffic?

The correct answer is C. firewall-cmd --add-port=1234/tcp. firewall-cmd --add-port=1234/tcp adds a temporary (runtime-only) rule to allow TCP traffic on port 1234. Because the --permanent flag is omitted, the rule applies immediately but is not saved across reboots, which satisfies the requirement to permit access 'temporarily.' Option…

Security

Question

A systems administrator wants to permit access temporarily to an application running on port 1234/TCP on a Linux server. Which of the following commands will permit this traffic?

Options

  • Afirewall-cmd --new-service=l234/tcp
  • Bfirewall-cmd --service=l234 --protocol=tcp
  • Cfirewall-cmd --add-port=1234/tcp
  • Dfirewall-cmd --add-whitelist-uid=l234

How the community answered

(64 responses)
  • A
    6% (4)
  • B
    3% (2)
  • C
    78% (50)
  • D
    13% (8)

Explanation

firewall-cmd --add-port=1234/tcp adds a temporary (runtime-only) rule to allow TCP traffic on port 1234. Because the --permanent flag is omitted, the rule applies immediately but is not saved across reboots, which satisfies the requirement to permit access 'temporarily.' Option A (--new-service) creates a new named service definition, which is not how ports are opened directly. Option B uses --service and --protocol as separate flags, which is not a valid firewall-cmd syntax for adding a port. Option D (--add-whitelist-uid) is not a valid firewall-cmd option - firewall-cmd does not use whitelists or UIDs for port-based rules.

Topics

#Linux firewall#firewall-cmd#port management#network access control

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice