October 2008.
My main computer is a Mac, but I do a fair amount of work on several remote Mac OS, UNIX, and Linux computers. SSH in Terminal is great for running remote commands, but what about working locally with remote files? By working, I mean writing running my familiar local tools such as local editors, local viewers, and local version control systems on remote files.
Obviously, I could run remote tools on my remote files, but having become accustomed to Mac OS tools, I often find using UNIX and Linux tools to be quite awkward.
There are simple solutions to certain special cases of this problem. For example, if I only need to edit remote files, I could edit a local copies and push them to the remote computer with rsync or I could use editor-specific features such as the ability of BBEdit to open a file over SFTP. However, the general case is more difficult; BBEdit can’t help me open a remote PDF file in Preview or view a remote FITS file in SAOImage.
I have found a simple general solution in ExpanDrive; I use it to mount the remote filesystem and use my standard local Mac OS tools.
ExpanDrive accesses the remote file system using SFTP rather than AFS, NFS, or SAMBA. Thus, if you can SSH into a remote computer, you can mount its files with ExpanDrive. ExpanDrive works seamlessly with the Keychain to provide password-less authentication. Local caching helps make the performance acceptable.
The remote filesystem is presented as a standard device that can be seen by the Finder and all of the local Mac OS applications.
As far as accessing my remote files is concerned, ExpanDrive is tantamount to a light-weight and easily configurable VLAN.
ExpanDrive costs $40 and is available with a 30-day trial period. It is available both for Mac OS X and Windows.
See Also
Notes
FTP and S3 Access
ExpandDrive can also access remote filesystems using FTP and S3 buckets.
Synchronizing Local and Remote Files
One solution is to maintain synchronized copies of the files locally and remotely. Running rsync —update twice, once to push and once to pull changes, will accomplish this, but in order to delete or move a file I must do so both locally and remotely, which is inconvenient.
Tools such as Dropbox, SugarSync, and PowerFolder don’t have this problem, but they can be slow as synchronization is mediated by a cloud server. (Dropbox and PowerFolder can synchronize more quickly over a LAN or VPN, but I typically work on computers that are not on the same LAN as my local computer and without a VPN.)
Network File Systems
Of course, the “right” solution is to mount the remote file system locally using a network file system such as NFS or CIFS (SMB). There is only one copy of each file, so there is no need for explicit synchronization, and deletes and moves work as expected.
However, configuring the remote computer to share its file system is typically non-trivial and requires root privileges. Furthermore, NFS and CIFS are optimized for LANs, but not all of my remote computers are on the same LAN as my local computer. Network file systems optimized for WANs are not yet common.
WebDAV
I could work on a WebDAV file system shared between the local and remote computers. However, this requires non-trivial configuration on each remote computer and does not give access to arbitrary files (e.g., .profile and .ssh/config).
Copyright © Alan Watson 2008—2009