Tuesday, December 1, 2009

Mounting a home directory of Linux on Windows through SSH

You have an account on a remote Linux machine and you work on a Windows machine. How do you mount the remote machine file system on the local machine so that you can access all your files on the remote machine as if they are on the local machine. This is very convenient compared to file transfer if you edit files on the remote machine regularly.

Approach# 1
There are two commercial solutions:
  1. SFTDrive or ExpanDrive
  2. Webdrive
But unfortunately, there are no free solutions for mounting through SSH.

Approach# 2
There is a free (for home use) software which allows for mounting through FTP and WebDAV.
  • http://www.netdrive.net./
You can install a ftp server or webDAV server in your account, and use this client. You may need to forward some ports. I don't know how hard will it be to configure and run a ftp server or webDAV server from a user account and the security implications of this.

Approach# 3
Install samba server in your account, and use Windows SMB client. You may need to do some port forwarding and probably disable SMB server on the Windows machine. I don't know how hard will it be to configure and run samba server from a user account and the security implications of this.

Approach# 4
Install sshfs in the Ubuntu in virtual box on the local machine, export the file system as SMB share and mount on Windows. This is my preferred approach as I don't have to worry about security and server configurations. The Ubuntu is behind Windows network, so it can connect to outside world, but only my Windows box can connect to it.


Update


I have tried a couple of things from above.

My use case: I edit files on Windows, but run my scripts and experiments on Linux which generate lot of other files and graphs which I open on Windows for viewing.

Approach#1 is easiest. I tried both WebDrive and Expandrive.

Webdrive: It has caching which was a big problem for me because my files get changed on both sides. And if caching is disabled, it is slower than a tortoise. After looking into log file, I discovered that it was running dozens of commands for simple things like saving a file. In one word: Webdrive sux.

Expandrive/Sftpdrive: It has no caching and is superfast. The only problem is that it will change the permissions on the files. When I edited some executable perl script files, it removed the executable bit from the file permission which was kind of irritating. So I have to say good-bye to expandrive, although I might consider this software in future since more or less it is an excellent software.

Approach# 4: This has lot of technologies involved: Virtualbox, Ubuntu, sshfs, samba. This is as fast as Expandrive and it keeps the permissions of the files. So this is my preferred setup. The only problem is I need to keep VirtualBox+Ubuntu running.

In the end, both Expandrive and Approach#4 are good. But I prefer Approach#4.

Update 3/26/2010

I found FUSE and sshfs equivalents for Windows:
http://code.google.com/p/dokan/
http://dokan-dev.net/en/
I haven't tried it, but looks OK.

No comments:

Post a Comment