Wednesday, January 28, 2015

Show all active TCP connections

To display all active TCP connections, at your command prompt:
netstat -tnlp
For example, from an AWS instance setup for serving web pages:
[root@t2-micro ssh]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address        Foreign Address       State       PID/Program name
tcp        0      0 0.0.0.0:80           0.0.0.0:*             LISTEN      2201/nginx
tcp        0      0 0.0.0.0:22           0.0.0.0:*             LISTEN      5103/sshd
tcp        0      0 127.0.0.1:9000       0.0.0.0:*             LISTEN      2197/php-fpm
tcp        0      0 0.0.0.0:3306         0.0.0.0:*             LISTEN      2723/mysqld
tcp        0      0 :::22                :::*                  LISTEN      5103/sshd

No comments:

Post a Comment