Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a rather complex server setup consisting of a reverse SSH tunnel through a Linux VPS.

Namely, server A is a Mac Mini and runs a script which reverse tunnels to the VPS, which we'll call B. Accessing the services is done by using the hostname of the VPS (B), where the ports are forwarded to the Mini (A).

On A, the script looks like:

ssh -gnN -R *:80:localhost:80 -R *:XX:localhost:XX ...other_forwards... root@hostname_of_B

This allows ports on B (for example 80 as shown) to forward into the server.

I have many such ports configured, and most recently I attempted to set up SMB sharing by forwarding TCP ports 139 and 445. Unfortunately, this doesn't work.

I verified that on the internal network I can directly connect to A using SMB. But if I try to connect through B, my client says "the server may not exist or is unavailable...". I see no errors on the remote tunnel script or in the system log on server A, and similarly I don't see any errors on server B when trying to connect, so I'm not sure where to look for problems.

share|improve this question
why not set up a VPN connection between the two and be done with it? – HBruijn Jun 30 '14 at 19:25
@HBruijn Because a VPN connection can't work over a reverse tunnel because it uses ESP packets which can't be forwarded. – Justin Mrkva Jun 30 '14 at 23:56

Your Answer


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

Browse other questions tagged or ask your own question.