The connection is established from Desktop(D) to Server(S) with ssh -D PORT username@Server
.
From the Server, the list of ssh users connected can be obtained with who
, but the ssh tunnels are not listed in who
or w
. Also, with netstat -lnpt | grep ssh
, the connected user is not listed.
With other commands, such as ps aux | grep ssh
or lsof -i -n | egrep '\<ssh\>'
, a lot more information is retrieved, looking as if more users were connected.
Is there a (What is the) reliable way of getting the list of ssh tunnels with their respective users on S, ideally including the IP address of D?