Summersault
Home About Us Services Portfolio Community Support
Database Driven Websites
community home
local community
partner community
online community
weblog


Archives: Categories: Authors:

 

Summersault Weblog

turn any ssh-accessible box into an instant personal file server

Posted by Mark Stosberg on April 23rd, 2005

I love simplicity, and I found it today in shfs, a tool that allows me to
browse any server I can ssh into as a local file system.

Consider this common case: I’m working on some content for my website at home, and I’m ready to upload to my website. I can only access with SSH-based tools, to prevent my password from being sent in the clear, as FTP would do. That means my choices are basically ssh, scp, and sftp.

As a Linux user, I have another option, referred to sometimes as the ‘fish protocol’ which allows me to browse the remote machine in Konqueror, A Linux answer to the Mac Finder or Window$ Explorer. It uses SSH behind the scenes.

This is quite nice, but I’m not always a drag ‘n’ drop kinda guy, if you know what mean. I like that command line action for super geeky efficiency.

I was tickled when accidently discovered that tab completion could work with scp, easily completing file name on the remote machine as I typed them locally.

Still that wasn’t quite nerdvana. shfs takes me a step in that direction, by easily allowing me to mount any remote directory that I ssh to, allowing me to work with it as if it were apart of my own hard drive.
It’s really this easy:

    $ shfsmount mark@remote /mnt/remote
    

After that, I can browse the remote machine as /mnt/remote on on local machine, using my choice of command line and graphical software.

In this case, I didn’t even have to type a password, as my credentials for the remote host are already being managed by ssh-agent.

Secure and simple.

The underlying technology here appears fairly unique to Linux to right now. It’s called FUSE, and allows for other other interesting file system hacks as well. encfs intrigues me as a very easy and natural way to use an encrypted folder. A more eccentric use is GmailFS claims to allow Linux users to use their Gmail account as if it were a 1 Gigabyte hard drive attached to their desktop computer.

I almost forgot to mention how I got shfs installed, because it was a nearly instant and unmemorable process. I simply searched for ’shfs’ in the Mandriva software installation tool, and installed the prepackaged shfs-utils that Mandriva provided. There was really no configuration to speak of either, except that I followed the provided instructions for allowing users to use the command in addition to root.

update: tip: If the ssh connection dies, you can force unmount the connection as root:

umount -f -l /mnt/remount

See Also:


Did you find this entry interesting or useful? Please tell us about it!

Leave a Reply

The opinions expressed by individuals posting in the Summersault Weblog are not necessarily those of Summersault, LLC. While we try to insure the quality and accuracy of the information presented here, we make no guarantees about its suitability for any particular purpose.