So you’ve got a Ubuntu based NAS (in my case a Raspberry Pi with 2TB external hard drive mounted) and a hoseted server? Wouldnt it be great if you could mount your NAS to your server? Here’s how to do it!

You won’t find many commands here. Every machine is different so its up to you to do the configuring. There are plenty of guides that can show you how to do each of the steps listed below. Good luck!

Setup Reverse SSH Between the Client and the Server

Use this guide as a start: How to Setup Reverse SSH Tunnel on Linux

Use autossh and SSH Keys

The latter half of this article will get you set up with autossh: Persistent reverse (NAT bypassing) SSH tunnel access with autossh

Now you’ll have a persistent and automatic reverse ssh tunnel to your server.

Install sshfs on the Server

sudo apt-get install sshfs

Mount the Client

sshfs -p <reverse tunnel port> <localUser>@localhost:/home/localUser RemoteFolder/

If this works, then go ahead and make an entry in your /etc/fstab file.

Leave a Reply

Your email address will not be published. Required fields are marked *