Solved Get the IP address of all sshd connections.

I am looking for a reliable way of getting the IP origin of all pts sessions. The lastutility would be perfect other than it prints the host name and not the ip address. And I cannot see any way to force it to print the numeric address instead. Is there something similar that will?


A: I used netstat.
Code:
netstat -an | grep ESTABLISHED | grep '\.22 ' | \
      cut -w -f 5 | cut -d '.' -f 1-4 | \
      sort -u -V
 
Back
Top