Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using lsof -i I can see there is a reverse ssh tunnel set up on my server:

sshd       1321   remote    8u  IPv4 219299       TCP localhost.localdomain:mvs-capacity (LISTEN)

How can I find out the IP address of the machine that created this tunnel?

Thanks

share|improve this question
add comment

4 Answers

Run lsof -i | grep 1321 to see the other connections the pid has, one of which should be the ip of the machine that created the tunnel.

share|improve this answer
add comment

or you can use netstat -a

share|improve this answer
add comment

Try netstat -ntp | grep 1321 (replace 1321 with the pid of the process in question.). This will allow you to see the network connections.

share|improve this answer
add comment

lsof -nPp 1321

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.