List active ssh connections

Linux
1. w

The w command gives information about currently logged in user such as ip, login times, load average :

w
08:06:55 up 3 days,  1:30,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    197.27.57.174    08:06    2.00s  0.01s   ?    w
2. ss (Socket Statistics) instead of netstat

ss is part of the iproute2 package, which is the modern networking tool suite for Linux, it can easily replace the old method using netstat and gives improved performance and more features. Netstat considered as deprecated, even tells us to use ss instead in its man page!

NOTES
This program is mostly obsolete. Replacement for netstat is ss. Replacement for netstat -r is ip route. Replacement for netstat -i is ip -s link. Replacement for netstat -g is ip maddr.

ss | grep -i ssh

Previous Post Next Post