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).
Click on the arrows to vote for the correct answer
A. B. C. D. E. F.AB.
The two commands that can be used to see which ports are currently open on the mail server are B. netstat and A. lsof.
B. netstat is a command-line tool that displays active network connections, routing tables, and a list of listening ports on the server. To view which ports are currently open, the administrator can run the command "netstat -ltn" which will show all listening TCP ports. The output will display the port number and the process that is using it.
A. lsof is another command-line tool that lists all open files in a Linux system. This includes network sockets, so it can also be used to see which ports are currently open. The administrator can run the command "lsof -i -P -n" to show all open network connections and the process that opened them. The "-i" option specifies to list only network connections, the "-P" option ensures that port numbers are displayed instead of service names, and the "-n" option prevents the command from resolving IP addresses to hostnames.
C. ipconfig is a command used in Windows to display the IP address, subnet mask, and default gateway of a network interface. This command is not available in Linux.
D. traceroute is a command used to trace the route that a packet takes from one network device to another. It is used to diagnose connectivity issues and does not display open ports.
E. ping is a command used to test network connectivity between two devices. It sends an ICMP echo request to a specified IP address and waits for a response. It does not display open ports.
F. dig is a command-line tool used to query DNS servers for information about a domain name. It is not used to display open ports.
In summary, the two commands that can be used to see which ports are currently open on a Linux mail server are B. netstat and A. lsof.