I tunneled data transition as 22-22 and 2222-80, between my PC and VPS:

ssh user@ -L 22:localhost:22 -L 2222:localhost:80 -i ~/.ssh/key

To make sure both tunnels were created, I executed lsof -i -n -P | grep ^ssh after logging in to the server.

Here is the stdout. You can see that only port 22 is present, without 2222:

sshd     1785     root    3u  IPv4  17568      0t0  TCP *:22 (LISTEN)
sshd     1785     root    4u  IPv6  17570      0t0  TCP *:22 (LISTEN)
sshd    31511     root    3u  IPv4 447661      0t0  TCP SERVER_IP:ssh->ISP-acronym-LOCAL_IP.ISP-subdomain.ISP-domain:52086 (ESTABLISHED)

My question:

My question can actually be comprised of the following 2 questions:

  1. What might have went wrong so that only a 22 tunnel appears, but no 2222 tunnel? Please advise me what's worth checking in my system and I will update this question.

  2. What is this IPV6 there in the second column? Neither my PC, nor my VPS, has a IPV6 IP.


  1. The system I tunnel from is WSL Ubuntu. Very basic; A fresh install with no utilities installed besides fail2ban. I just login with the already existing OpenSSH and that's basically it.
  • You are apparently looking at sshd on the server. (Maybe you typed this in the remote shell run and connected by ssh?) The LISTENs for -L tunnels should be on the client where you are running ssh.(Also -D, while -R LISTENs on the server and tunnels to the client.) I don't know if WSL has lsof; if not try netstat or ss. Re IPv6: if real Linux the server has a dual stack whether or not it has an IPv6 address. – dave_thompson_085 Dec 30 '16 at 7:44
  • I typed this in the remote shell (VPS), indeed. Also, indeed it seems current release of WSL doesn't have lsof... netstat or ss doesn't seem to return any values at all when I run them in a second, local WSL session (after I already logged in). Please honor me with any other advise you might have. – JohnDoea Dec 30 '16 at 10:31
  • WSL does have lsof, netstat and ss. Make sure you are up-to-date with Windows updates AND that you have done sudo apt-get update && sudo apt-get upgrade – Julian Knight Dec 30 '16 at 11:17
  • Of course, that doesn't mean they return quite the same information than on a real Ubuntu Linux system. Certainly not all system-level information is available to the Ubuntu subsystem due to the different way that the Windows Core works. I'm not even sure if running another window creates a separate environment, you might need to use screen. – Julian Knight Dec 30 '16 at 11:19
  • Is there no way to check if both tunnels were established from the VPS's end? – JohnDoea Dec 30 '16 at 23:33

After running netstat -tulpn I did saw to conenctions, one is to port 22, and one is to port 80.

So it seems the tunneling didn't fail.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.