jump to navigation

HOWTO: Install fuse + sshfs on CentOS Linux June 8, 2006

Posted by devhen in CentOS, HOWTO, Linux.

UPDATED Dec-19-2006:

NOTE: These instruction are for CentOS 4.

The apt-get method of installing sshfs that I had posted here previously did not work for me. I got this error when trying to mount an ssh drive:

shfsmount: shfs filesystem not supported by the kernel

So, I set out to find a different method of installing sshfs (and fuse, which it requires). One, preferably, that would actually work. Well, I found one. Its not the most elegant solution but its effective.

First, download a copy of the fuse source rpm:

wget http://www.devhen.net/centos/fuse-2.6.0-1.src.rpm

Next, install the source rpm and then build the proper fuse rpm’s from the .spec file:

rpm -ivh fuse-2.6.0-1.src.rpm
rpmbuild -bb /usr/src/redhat/SPECS/fuse.spec

Next, install the rpms that you have built:

cd /usr/src/redhat/RPMS/i386 (replace ‘i386’ with your arch, if necessary)
rpm -Uvh fuse-2.6.0-1.i386.rpm fuse-kernel-2.6.0-1.i386.rpm fuse-libs-2.6.0-1.i386.rpm fuse-devel-2.6.0-1.i386.rpm

Now you can install the sshfs-fuse rpm:

wget http://www.devhen.net/centos/sshfs-fuse-1.6-2.i386.rpm
rpm -ivh sshfs-fuse-1.6-2.i386.rpm

** You can try building the sshfs-fuse rpm from its source package if your not on i386**

Now comes the ugly part… For some reason the system can’t find the fuse module after installing these packages. So, head over to the fuse project homepage and download fuse-2.6.0.tar.gz. Unpack it and then

make install

and you should be in business. As I said, this is not an elegant solution because you are installing fuse from the tar.gz file on top of the fuse rpms. However, it works for me and that’s all that matters right now because I really needed to mount some ssh drives on my workstation. 😉

Mount an ssh drive like so:

sshfs user@remotesystem:/path/you/want/to/mount/ /mnt/mount-point/ -o allow_other

Don’t forget the trailing /’s on both the source folder and the mount point. -o allow_other will give all users access to the mounted drive. Type sshfs -h for a list of all of sshfs’ options.



1. siim - February 1, 2007

unable to compile on centos 4.4.
kernel-2.6.9-42.0.8.EL.src.rpm is installed and all, but still fails

checking kernel source directory… Not found
configure: error:
*** Please specify the location of the kernel source with
*** the ‘–with-kernel=SRCDIR’ option
configure: error: ./configure failed for kernel
error: Bad exit status from /var/tmp/rpm-tmp.31432 (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.31432 (%build)

2. siim - February 1, 2007

not to compile.. i mean rpmbuild

3. devhen - February 1, 2007


yum install kernel-devel

and then it should work. 😉

4. David Nalley - March 11, 2007

It doesn’t look like the spec file calls depmod -a which I think should take care of the module missing issue you refer to and keep you from having to go the source route.

5. William Fong - March 26, 2007

Version Info:
CentOS 4.4
fuse 2.6.3
sshfs 1.7

Download fuse 2.6.3
Unpack it.
Do a CVS checkout of fuse. Grab the kernel/fuse_i.h and copy it to the 2.6.3 package.
Do the ./configure; make; make install dance
Add /usr/local/lib to /etc/ld.so.conf
Run ldconfig
Download sshfs
Do the ./configure; make; make install dance

That should do the trick! There is a “bug” about a missing mutex_destroy symbol in 2.6.3, but it’s fixed in CVS.

I think that should do it!

6. LarryT - April 4, 2007

Links are borken 😦

7. Shelby - April 10, 2007

I am trying this on a Virtual Dedicated Server, which is running CentOS 4.4.

root@vps [/root]# rpmbuild -bb /usr/src/redhat/SPECS/fuse.spec
error: Unable to open temp file.
RPM build errors:
Unable to open temp file.
root@vps [/root]#

8. Marcelo Monteiro - June 10, 2007

“Now comes the ugly part… For some reason the system can’t find the fuse module after installing these packages.”

Execute “depmod -a”

9. Joseph Lundgren - June 22, 2007

In hopes of getting ZFS-on-FUSE/Linux working properly, I (thankfully!!) stumbled accross this webpage. I just did a fresh installation of CentOS 4.5 using a minimal installation (I only selected the Developer group, and de-selected everything else).

I then installed the rpmforge yum repository, and brought the machine up to current patch level.
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
# yum -y update

Upon reboot, I installed ‘scons’
# yum install scons

I then downloaded the FUSE sourcecode RPM and installed it as the instructions above specify. It’s IMPORTANT to install the RPM’s in the correct order. Actually, just make sure that ‘fuse-2.6.0-1.i386.rpm’ is installed last, and you’ll be ok.

10. Joseph Lundgren - June 22, 2007

oops… never mind that part about installing ‘scons’. It’s for the next step in my ZFS-on-FUSE/Linux installation.

11. phil - March 3, 2008

and it work great for me

12. ComputerJobs.VN - April 26, 2008

Is there any update for CentOS 5.1?

13. TerryA - November 26, 2008

I had success on Centos 4.7

Followed instructions above but used latest tarball fuse-2.7.4.tar.gz

I did get a message “don’t know how to make device “fuse””
but the RPMs installed so I ignored and pressed on.

Worked first go.

Many thanks.

14. foo - January 14, 2009

I ran into this problem as well; sshfs would tell me:
fuse: device not found, try ‘modprobe fuse’ first

I was able to get this working by installing the Centos Dynamic Kernel Module Support package from rpmforge. On boot, dkms loads and compiles the fuse module. Otherwise, it was nowhere to be found in /lib/modules.

A second problem I ran into, was that udev and haldaemon would hang on boot because the fuse group did not exist in /etc/groups. It was there at one time, but until I added it by hand, the system would not finish booting.

15. hugh VK - February 14, 2009

when i install sshfs, it’s complaining glib2 is missing. Cant find it for centos though

16. montana - April 27, 2009

yum install glib

also: @siim:

had the kernel source installed but installing kernel-devel did the trick.


17. daniel - June 5, 2009

Worked fine on Enterprise Linux (El5). Also needed to install the kernel-devel. Used fuse 2.7.3.

Thanks for the how-to.

18. Laurence Sturner - August 9, 2015

Good article, thanks.

19. Ermelinda Garavaglia - August 9, 2015

Good article, thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: