nerdexam
CompTIA

XK0-005 · Question #291

A Linux administrator is developing a Bash script to close specific ports on a server firewall. The administrator is not certain of the default port for the Internet Message Access Protocol. Which…

The correct answer is D. /etc/services. The /etc/services file on a Linux system maps service names to their corresponding port numbers and protocols.

System Management

Question

A Linux administrator is developing a Bash script to close specific ports on a server firewall. The administrator is not certain of the default port for the Internet Message Access Protocol. Which of the following files should the administrator check to determine the default port?

Options

  • A/etc/network
  • C/etc/resolv.conf
  • D/etc/services

How the community answered

(33 responses)
  • A
    6% (2)
  • C
    3% (1)
  • D
    91% (30)

Why each option

The `/etc/services` file on a Linux system maps service names to their corresponding port numbers and protocols.

A/etc/network

`/etc/network` (or `/etc/sysconfig/network-scripts` on some distributions) typically contains network interface configuration files, not service port mappings.

C/etc/resolv.conf

`/etc/resolv.conf` is used to configure DNS resolvers, specifying IP addresses of DNS servers, not service port mappings.

D/etc/servicesCorrect

The `/etc/services` file is a standard configuration file in Linux that contains a list of known services, their corresponding port numbers, and the protocols (TCP/UDP) they use. An administrator can consult this file to determine the default port for specific services like IMAP.

Concept tested: Linux service port configuration file

Source: https://man7.org/linux/man-pages/man5/services.5.html

Topics

#/etc/services#Port numbers#Network protocols#Linux administration

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice