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.