2

I'm missing a piece of this puzzle so I hope someone can help me.

The SETUP: My computer with Windows O/S is behind a NAT/Firewall at work and I can not open any ports to forward. At home I have a Ubuntu Server. I'm able to use a ssh client (putty) to connect from the Windows computer at work to my Ubuntu Server at home. Using port forward in putty, I made a network share on my Windows computer that is connected via smb to a network share on my Ubuntu Server at home.

The Problem: I would like to REVERSE the smb share described above by using a Reverse SSH tunnel connection.

WHAT I MEAN IS: Use Reverse SSH with SMB ports (445) to connect & mount to Windows share (behind NAT) FROM Ubuntu Server.

Questions:

How would I setup my Reverse SSH tunnel in putty? (again I understand Reverse SSH). Right now under the tunneling option in Putty I have port 445 as my source, localhost:445 as my destination and REMOTE & IPV4 options selected. Is this correct?

Once I get the Reverse SSH tunnel setup correct for SMB, how do I connect and mount a Windows share that is behind the NAT FROM my Ubuntu Server? Same way if Ubuntu Server was to mount share with Windows computer on same Network? sudo mount -t cifs //IPADRESS/WinShare /mnt/UbuntuShare -o username="Username",domain=

If you have any questions please let me know and I will get back to you ASAP!

Thanks, Ben

...

1 Answers1

1

Well I figured out the answer to my OWN question. This resolves the question "How to connect to a share using SSH Reverse" If you do not know what SSH Reverse is please disregard this solution!

My setup: Computer A= Ubuntu Server running SSH Server at home. (Diff network)

Computer B= Windows Desktop behind work firewall (cannot open ports) (Diff network)

Like I said, I CANNOT open ports for Computer B and I need Computer A to be able to mount a share (securely) on Computer B .

What this means:To share file between Computer A and Computer B I cannot use FTP,SFTP,or even SSH using port forward because the Ports on Computer B are not open!

HOWEVER, there is a solution to this! Its called SSH Reverse. I won't get to far into this but for my setup Computer A has a SSH Server running on it and Computer B has a client(like putty/plink). Remember to goal is to share files with Computer B from Computer A so in this scenario you MUST you SSH reverse.

So 1st make sure you can communicate/connect with your SSH Server on Computer A with your client (I'm using putty) on Computer B. Works? Great moving on...

Now you need to setup your Reverse Port Forward in putty (on Computer B) by selecting saved connection and going to Tunnel option. Next you need to "Add new port forward".

The source port can be any open port. If your not sure use: 5454. The destination should be: localhost:445 NOTE: destination DOES NOT have to be localhost, in fact localhost may output as "Host Down". It can be any IP on network. Example 192.168.1.1:445 (your own IP)

Make sure the Remote button and Auto button are selected. Then click Add and make sure you SAVE the settings for that connection before you open that connection. Now connect to your SSH Server (Computer A).

Now don't forget to create a mount folder( any folder that the mount share will show up in).

Now you should be able to mount your share on Computer B with Computer A with out opening any ports.

Example mount code:

sudo mount -t cifs //localhost/sambashare /mountpoint -o port=5454,username="",password="",domain="optional"