How to Mount a Remote Filesystem Using SSH and sshfs

From time to time I work on remote servers and some times it would be very useful to be able to mount the remote file system on my local machine. Recently I found sshfs, which is a filesystem client based on the SSH File Transfer Protocol and since most *nix like servers; Linux, FreeBSD, NetBSD, OpenBSD servers with OpenSSH installed already support this protocol it is very easy to set up - Read: on the server side there's nothing to do, setup or configure. On the client side mounting the filesystem is as easy as logging into the server with SSH.

Technically (more) the sshfs is based on FUSE, which is the best userspace filesystem framework for linux ;-)

Here is how I connect to my remote SSH-based servers and hosts:

$ sshfs -o uid=1000,gid=1000 cc@remote.host.com:/home/cc /media/mountpoint

I use the uid and gid arguments to give my own normal user with those uid and gid to have write access to the mounted filesystem.

This post describes the sshfs in more details and moreover howto use it on Ubuntu and Debian.

The sshfs website.

Comments

blog comments powered by Disqus
Fork me on GitHub