Mounting a remote SSH filesystem
June 5, 2006 by Isaac
On a typical project there are many different computers that I must use. For years I have been using scp to copy files from one computer to another and wishing for a way to just mount the SSH filesystem. Well, my wish finally came true!
The good news is that thanks to sshfs I can now mount all of my remote directories to local mount points. The better news is that any normal user (meaning non-root user) can mount a SSH filesystem. The best news? Only the client side needs any special software installed. The server side is just a normal ssh daemon. The only catch? The root user must install sshfs on the client machine.
SSHFS relies on a project called FUSE to be installed first. FUSE is a library to create filesystem that can be mounted in userspace. There are many projects based off this project including some filesystems that can mount a compressed file to a normal filesystem. Navigate on over to http://fuse.sourceforge.net and download the latest. After extracting the files from the tarball, run the following:
./configure make make install (as root)
Once FUSE is installed then download and install sshfs doing:
./configure make make install (as root)
Now, as an ordinary user you can just mount a ssh filesystem by doing:
sshfs username {at} host.that.has(.)filesystem: mountpoint
That's it! The mounted directory can now be used just like any ordinary directory. Already the discovery of this great tool has saved my fingers from typing unnecessary scp commands. I love it!
Once you are finished with the mount you can unmount it by doing:
fusermount -u mountpoint
Happy SSH'ing!
Posted in 
content rss
