In Linux, which command line tool should you use to list a host's active incoming connections?

Study for the ITS Networking Test. Prepare with flashcards and multiple-choice questions. Each question includes hints and explanations. Get ready to excel in your exam!

Multiple Choice

In Linux, which command line tool should you use to list a host's active incoming connections?

Explanation:
To see who is connecting to your machine, you need a tool that shows socket states for network connections. The modern, efficient choice is ss, which is designed to replace the older netstat and provides the same kind of information about active and listening sockets, but faster and with more options. To list active incoming connections, focus on TCP sockets and their state. For example, you can view all TCP connections and then filter for established ones, which represent active connections. A common approach is to run something like ss -tan | grep ESTAB to show established TCP connections, where the local side is the host and the remote side is the peer. If you want to see sockets that are listening for new incoming connections (i.e., potential inbound connections), use ss -tuln, which shows listening TCP sockets and their ports. Netstat can perform similar tasks, but ss is preferred on modern systems. Ifconfig is for configuring interfaces, not for listing connections, and lsof can show open files including network sockets but isn’t as straightforward for a quick view of current inbound connections.

To see who is connecting to your machine, you need a tool that shows socket states for network connections. The modern, efficient choice is ss, which is designed to replace the older netstat and provides the same kind of information about active and listening sockets, but faster and with more options.

To list active incoming connections, focus on TCP sockets and their state. For example, you can view all TCP connections and then filter for established ones, which represent active connections. A common approach is to run something like ss -tan | grep ESTAB to show established TCP connections, where the local side is the host and the remote side is the peer. If you want to see sockets that are listening for new incoming connections (i.e., potential inbound connections), use ss -tuln, which shows listening TCP sockets and their ports.

Netstat can perform similar tasks, but ss is preferred on modern systems. Ifconfig is for configuring interfaces, not for listing connections, and lsof can show open files including network sockets but isn’t as straightforward for a quick view of current inbound connections.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy