Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

How it works...

ss is a quick way of determining the sockets that a system is currently using, and it's not limited to TCP or UDP, as it's also able to display Unix domain sockets (-x).

In this example, we've queried the system to find out which ports are in use, and ss has performed some resolution work to determine what services those ports are likely to be used by.

This is not a guarantee, however. For example, if you start a Python web server on 2222, it would list the following:

$ ss -l sport = :2222Netid  State      Recv-Q Send-Q                                      Local Address:Port                                                       Peer Address:Port                tcp    LISTEN     0      5                                                       *:EtherNet/IP-1                                                         *:*     

This is simply because as far as /etc/services is concerned, this port is used by EtherNet/IP-1:

$ grep "^EtherNet" /etc/servicesEtherNet/IP-1 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content