2014-02-26 20:51:09 +04:00
|
|
|
# ss
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Utility to investigate sockets.
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-24 18:45:44 +03:00
|
|
|
- Show all TCP/UDP/RAW/UNIX sockets:
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-25 12:52:05 +03:00
|
|
|
`ss -a {{-t|-u|-w|-x}}`
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Filter TCP sockets by states, only/exclude:
|
2014-02-26 20:51:09 +04:00
|
|
|
|
|
|
|
`ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}`
|
|
|
|
|
2016-01-24 20:02:53 +03:00
|
|
|
- Show all TCP sockets connected to the local HTTPS port (443):
|
2016-01-24 18:45:44 +03:00
|
|
|
|
|
|
|
`ss -t src :{{443}}`
|
|
|
|
|
|
|
|
- Show all TCP sockets along with processes connected to a remote ssh port:
|
|
|
|
|
|
|
|
`ss -pt dst :{{ssh}}`
|
|
|
|
|
2016-01-24 20:02:53 +03:00
|
|
|
- Show all UDP sockets connected on specific source and destination ports:
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-24 20:02:53 +03:00
|
|
|
`ss -u 'sport == :{{source_port}} and dport == :{{destination_port}}'`
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-24 18:45:44 +03:00
|
|
|
- Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16:
|
2014-02-26 20:51:09 +04:00
|
|
|
|
2016-01-24 20:02:53 +03:00
|
|
|
`ss -4t src {{192.168/16}}`
|