RSS

Creating A Shared Drive On Your Linux Server

This entry was posted on Jun 04 2009

There is a great and popular service called Dropbox where you create your own remote drive that is available to all your computers as a folder on your desktop. The folder itself lives on the dropbox’s server and a copy of your local dropbox folder is continually synchronised with the remote one. Therefore if you’re at work and drop a file into your local dropbox folder, that same file is available to you at home in that dropbox folder.

I have wanted something like this for some time but found I could not get it to run on my Kubuntu workstation running the Fluxbox window manager. After spending a long time searching Google I thought there must be a simple alternative available for Linux that didn’t require any additional software that I could host on my virtualhost at Slicehost.

I was almost right. I needed to install one program locally but it couldn’t be any simpler. Install sshfs with the following command (For Debian/*buntu machines)

sudo apt-get install sshfs

Once installed you need to create your local mount point for the dropbox.

mkdir /home/username/dropbox

Create the dropbox path on your remoter server:

sudo mkdir /var/dropbox
sudo chown remoteusername:remoteusername /var/dropbox

With this prepared you can now connect to your dropbox using sshfs.

sshfs remoteusername@host:/var/dropbox /home/username/dropbox

Depending how you have sshd setup onthe remote host you may be asked to enter your password. Then the dropbox is available. If you copy any files across to the local /dropbox path they are moved to the remote dropbox path as they would with any symbolic link or drive.
By setting this up on other workstations you have effectively created your own dropbox.

This is effectively the same as when using Windows to map a network drive on your computer to the files system on a remote web server.

There are two major points here that Dropbox has that this method does not and that is version control and a web interface. Although, a simple web interface wouldn’t be that hard to create if someone was inclined.

The path can be unmounted using the command

fusermount -u /dropbox
Dropbox

Sorry, comments for this entry are closed at this time.