sshfs

Imagine the following situation: you have to compile some Linux/Unix application or kernel module that requires kernel source present at your hard drive, say, in /usr/src/kernels/kernel-2.6.21-i386/ or elsewhere. But there is not enough disk space to copy these sources or install kernel-devel or linux-source packages (in Fedora/RedHat or Ubuntu/Debian distros respectively)… Sounds familiar? Believe me, sometimes it happens :)

As a solution you can mount the directory of some remote PC that contains needed kernel source. It can be done via several protocols like smb, ftp etc. In this article we will mount remote directory using ssh protocol that is one the most popular for remote and secure access to Linux boxes over the network.

Below are the steps which should be taken to get the ball rolling. We need two packages: sshfs and fuse-utils.

ssh1. Install necessary packages:

a. Ubuntu/Debian:

sudo aptitude install fuse-utils sshfs

b. Fedora/Centos/RedHat:

yum install fuse-sshfs fuse fuse-libs

c. Other Linux: download and compile sshfs/fuse from sources

2. Check that kernel module fuse is loaded:

lsmod | grep fuse

There should be the line containing “fuse” in the output (of not try modprobe fuse).

3. Mount remote filesystem using something like this (two commands):

mkdir -p /mnt/sshfs/
sshfs remote-user@remote-machine:/some/directory /mnt/sshfs

where remote-user is the username allowed to login remote-machine via ssh protocol. It will ask you to type the password so just type it and press return :)

4. That’s it. Good luck!

 

27 Comments

 

  1. April 18, 2013  9:48 am by rados?aw tadajewski Reply

    Throughout this grand design of things you receive a B- for effort and hard work. Where exactly you confused me personally was first on your facts. As people say, details make or break the argument.. And that couldn't be more correct here. Having said that, allow me say to you precisely what did do the job. Your authoring is definitely pretty powerful and this is probably the reason why I am making the effort in order to opine. I do not make it a regular habit of doing that. Second, whilst I can certainly see a jumps in reasoning you make, I am not necessarily convinced of just how you seem to unite the details that help to make the final result. For right now I shall subscribe to your point but hope in the future you actually connect the facts much better.

  2. Pingback : How do you remotely administer your Linux boxes? - Just just easy answers

Leave a reply

 

Your email address will not be published.