Skip to content

Instantly share code, notes, and snippets.

@rjp
Created November 30, 2009 22:40
Show Gist options
  • Save rjp/245843 to your computer and use it in GitHub Desktop.
Save rjp/245843 to your computer and use it in GitHub Desktop.
zgrep 'Accepted' /var/log/auth.log* | awk '{print $9,$11}' | sort -u | while read i; do set -- $i; u=$1; h=$2; m=$(whois $h | egrep '^role|^netname' |sed -ne 's/^[^:]*: *//p' | tr '\n' ':'); echo "$u ${m:-$h}"; done | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment