Displaying 1 result from an estimated 1 matches for "i4tcp".
Did you mean:
_tcp
2011 Oct 08
2
Detect PID of sshd processes used by one public key; detect -R allocated port on the server
...ecause the potentially
hostile client could pass back a different number. I could then connect
to a port and be fooled into connecting to wrong client.
My plan was to get the PID of the sshd process, then use lsof to find
what ports it was listening on.
The lsof bit works:
$ lsof -n -p 12287 -a -i4tcp -a -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 12287 testuser 10u IPv4 10196497 0t0 TCP 127.0.0.1:54403
(LISTEN)
But there seems to be no way to get the PIDs of an ssh process associated
with a particular public key, as opposed to a particular user...