From 31c436299f6b9e99200039df247b1273352df4b6 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Sun, 24 Jan 2016 16:45:44 +0100 Subject: [PATCH 1/4] Reworked linux ss page --- pages/linux/ss.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pages/linux/ss.md b/pages/linux/ss.md index d1bb1a6178..945cb6894e 100644 --- a/pages/linux/ss.md +++ b/pages/linux/ss.md @@ -2,26 +2,26 @@ > Utility to investigate sockets. -- Dump all TCP/UDP/RAW/UNIX sockets: +- Show all TCP/UDP/RAW/UNIX sockets: `ss -a {{-t/-u/-w/-x}}` -- Show process(es) that using socket: - -`ss -p` - - Filter TCP sockets by states, only/exclude: `ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}` -- Filter sockets by address and/or port: +- Show all TCP sockets connected to the local HTTPS port: -`ss -t dst 1.2.3.4:80` -`ss -u src 127/8` -`ss -t 'dport >= :1024'` -`ss -x "src /tmp/.X11-unix/*"` -`ss -t state established '( dport = :ssh or sport = :ssh )'` +`ss -t src :{{443}}` -- Only list IPv4 or IPv6 sockets: +- Show all TCP sockets along with processes connected to a remote ssh port: -`ss {{-4/-6}}` +`ss -pt dst :{{ssh}}` + +- Show all UDP sockets connected on a local port within a range: + +`ss -u 'sport >= :{{lowest_port}} and sport <= :{{highest_port}}'` + +- Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16: + +`ss -4t {{192.168/16}}` From eb8636d3f01a6113e783a6feac95e0779a4fa1da Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Sun, 24 Jan 2016 18:02:53 +0100 Subject: [PATCH 2/4] Changed ss example to include description for sport --- pages/linux/ss.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/linux/ss.md b/pages/linux/ss.md index 945cb6894e..8f576e07ca 100644 --- a/pages/linux/ss.md +++ b/pages/linux/ss.md @@ -10,7 +10,7 @@ `ss {{state/exclude}} {{bucket/big/connected/synchronized/...}}` -- Show all TCP sockets connected to the local HTTPS port: +- Show all TCP sockets connected to the local HTTPS port (443): `ss -t src :{{443}}` @@ -18,10 +18,10 @@ `ss -pt dst :{{ssh}}` -- Show all UDP sockets connected on a local port within a range: +- Show all UDP sockets connected on specific source and destination ports: -`ss -u 'sport >= :{{lowest_port}} and sport <= :{{highest_port}}'` +`ss -u 'sport == :{{source_port}} and dport == :{{destination_port}}'` - Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16: -`ss -4t {{192.168/16}}` +`ss -4t src {{192.168/16}}` From 1a27899c0025f5fdc2bbcb04762712e8040de990 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Sun, 24 Jan 2016 23:03:14 +0100 Subject: [PATCH 3/4] Changed ss page to have `|` as option separator --- pages/linux/ss.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/ss.md b/pages/linux/ss.md index 8f576e07ca..835e9e0fcf 100644 --- a/pages/linux/ss.md +++ b/pages/linux/ss.md @@ -4,7 +4,7 @@ - Show all TCP/UDP/RAW/UNIX sockets: -`ss -a {{-t/-u/-w/-x}}` +`ss -a -{{t|u|w|x}}` - Filter TCP sockets by states, only/exclude: From 02c9d55af454ad3cd15fae100143bf9842f6f2f7 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Mon, 25 Jan 2016 10:52:05 +0100 Subject: [PATCH 4/4] Put dashes inside braces for ss command --- pages/linux/ss.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/ss.md b/pages/linux/ss.md index 835e9e0fcf..a8940c1f1b 100644 --- a/pages/linux/ss.md +++ b/pages/linux/ss.md @@ -4,7 +4,7 @@ - Show all TCP/UDP/RAW/UNIX sockets: -`ss -a -{{t|u|w|x}}` +`ss -a {{-t|-u|-w|-x}}` - Filter TCP sockets by states, only/exclude: