Madhav Kobal's Blog

This blog will be dedicated to Linux, Open Source and Technology news, affairs, how-tos and virtually EVERYTHING in these domains.

ss – Another Utility to Investigate Sockets

Posted by madhavkobal on 20/09/2009

After configuring services on the network in Linux system, it’s important for you to keep tabs on the ports that are actually listening on the system’s network interfaces. This is all more important because open ports are evidence of an intrusion. There are a Linux monitoring tools that will allow you the knowledge of open ports. There are some basic approaches for listing the ports that are listening on the network. Let’s have a look at one of the most easiest reliable ones.

We would like to show you the ss command to inspect the socket statistics. This is more reliable command that displays more TCP and state information than any other tools.

The ss command provides information about

  • All TCP sockets.
  • All UDP sockets.
  • All established ssh / ftp / http / https connections.
  • All local processes connected to X server.
  • All the tcp sockets in state FIN-WAIT-1 and much more.

ss  is  used  to  dump socket statistics. It allows showing information similar to netstat.  It can display more TCP and state informations than other tools

To display Socket Summary type this in the terminal

# ss -s

Sample Output

ss

Display all the open ports

# ss -l

Sample Output

ss2

To see the process names using open socket type this command

# ss -pl

Track who is responsible for opening socket/port

# ss -lp | grep

To show all the TCP sockets

# ss -t -a

To display all UDP sockets

# ss -u -a

Advertisements

2 Responses to “ss – Another Utility to Investigate Sockets”

  1. Raj said

    PLZ give some information regarding how to setup SMTP mail server…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: