nerdexam
CompTIA

SK0-004 · Question #125

An email administrator is tasked to setup a Linux mail server. One of the requirements is to close all ports except SSH, HTTPS, SMTP, POP3, and IMAP4. Which of the following commands should be used…

The correct answer is A. lsof B. netstat. To audit open ports on a Linux mail server, administrators use lsof and netstat, both of which can display active network connections and listening ports.

Server administration

Question

An email administrator is tasked to setup a Linux mail server. One of the requirements is to close all ports except SSH, HTTPS, SMTP, POP3, and IMAP4. Which of the following commands should be used to see which ports are currently open on the mail server? (Select TWO).

Options

  • Alsof
  • Bnetstat
  • Cipconfig
  • Dtraceroute
  • Eping
  • Fdig

How the community answered

(28 responses)
  • A
    82% (23)
  • D
    11% (3)
  • E
    4% (1)
  • F
    4% (1)

Why each option

To audit open ports on a Linux mail server, administrators use lsof and netstat, both of which can display active network connections and listening ports.

AlsofCorrect

lsof (List Open Files) is a Linux utility that displays all open files, including network sockets. When invoked with the '-i' flag, it lists all open ports and the processes listening on them, making it ideal for auditing which ports are active on the mail server.

BnetstatCorrect

netstat (network statistics) reports network connections, routing tables, and interface statistics on Linux systems. Using flags such as '-tuln', it shows all TCP and UDP ports currently in a listening state, providing a comprehensive view of which ports are open.

Cipconfig

ipconfig is a Windows-only command used to display IP address configuration and is not available on Linux, nor does it show open or listening ports.

Dtraceroute

traceroute maps the network hop path to a remote destination host and provides no information about which ports are open or listening on the local server.

Eping

ping sends ICMP echo requests to test host reachability and provides no information about open ports or listening services on the local machine.

Fdig

dig is a DNS lookup utility used to query DNS records such as A, MX, or NS records and has no capability to display open or listening ports on a server.

Concept tested: Linux commands for auditing open network ports

Source: https://man7.org/linux/man-pages/man8/netstat.8.html

Topics

#port management#lsof#netstat#Linux networking

Community Discussion

No community discussion yet for this question.

Full SK0-004 Practice