I am looking for a reliable way of getting the IP origin of all
A: I used
pts
sessions. The last
utility 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