What is special about using the -p option with netstat?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

What is special about using the -p option with netstat?

Explanation:
The important thing netstat -p shows is the ownership detail: it annotates each socket with the owning process’s PID and program name. This mapping is protected by the OS, so you generally must run as root (or with sudo) to see the PIDs for connections owned by other users, including root-owned ones. Without elevated privileges, you’ll still see maybe the socket lines, but the PID/program fields can be blank or show limited information. That’s why this option is considered special: it reveals which process is tied to each network connection, but access to that information is restricted by permissions. The other statements don’t fit because netstat’s purpose isn’t memory usage (it doesn’t print per-process memory) and it doesn’t restrict the view to listening sockets by default, and it isn’t primarily about hostname resolution (that behavior is controlled by name resolution options).

The important thing netstat -p shows is the ownership detail: it annotates each socket with the owning process’s PID and program name. This mapping is protected by the OS, so you generally must run as root (or with sudo) to see the PIDs for connections owned by other users, including root-owned ones. Without elevated privileges, you’ll still see maybe the socket lines, but the PID/program fields can be blank or show limited information.

That’s why this option is considered special: it reveals which process is tied to each network connection, but access to that information is restricted by permissions. The other statements don’t fit because netstat’s purpose isn’t memory usage (it doesn’t print per-process memory) and it doesn’t restrict the view to listening sockets by default, and it isn’t primarily about hostname resolution (that behavior is controlled by name resolution options).

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy