Skip to content

Instantly share code, notes, and snippets.

@mrjk
Created April 23, 2026 21:51
Show Gist options
  • Select an option

  • Save mrjk/3e9d2aec16b9e2b1c8a7bddf00a807f2 to your computer and use it in GitHub Desktop.

Select an option

Save mrjk/3e9d2aec16b9e2b1c8a7bddf00a807f2 to your computer and use it in GitHub Desktop.
Script to display whois connected to what
#!/bin/bash
title ()
{
local msg="$@"
echo
echo "========================"
echo " $msg"
echo "========================"
}
title "Current connections (who)"
who
title "List listening services (netstat -l)"
netstat -lntpu
title "Current SSH connections on port 22"
netstat -taupen | sort -k 7 | grep ':22[^0-9]'
#title "Current Proxmox API connection on port 8006"
#netstat -taupen | sort -k 7 | grep ':8006[^0-9]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment