Auto mounting using SSHFS and your /etc/fstab file (in Ubuntu)

Unfortunately, Ubuntu (Edgy and previous versions of Ubuntu) doesn’t seem to have a handy little script called mount.fuse which should come with the fuse-utils package.

This basically means it’s impossible to get Ubuntu to mount sshfs mounts upon startup (nicely), or using a nice and simple mount command like:

mount /my/sshfs/mount/point/

Anyway, personally, I find it really annoying. Yes, there are probably good reasons why they don’t include the script, but no I don’t care. Well, not until someone can tell me an easier/cleaner way of doing this.

First, you’ll need to:
sudo apt-get install sshfs
sudo apt-get install fuse-utils

Then, download mount.fuse (works with Edgy Eft Ubuntu, not sure about anything else!).. stick it in /sbin/ and then sudo chmod 777 /sbin/mount.fuse (or you could be more careful with those permissions).

You’ll want to add lines with this format to your /etc/fstab file:
sshfs#jrh@alf:/ /sshfs/alf fuse defaults,noauto,user 0 0

I’ve found there’s a lot of mount.fuse scripts out there, which expect the fstab lines to be in a different format..so it’s quite important to use the right mount.fuse with the right fstab formatting!

Finally, if this happens when trying to mount:

fusermount: mount failed: Operation not permitted

try this.. it’ll allow your normal user to run fusermount (as root iirc):
sudo chmod 4755 /usr/bin/fusermount

It continues to amaze me how few people actually use this method of mounting with sshfs…it just seemed to make sense to me! Please leave a comment if you have a problem with this so I can add more info if needs be.

Comments (7)

Dan MartinNovember 5th, 2006 at 4:26 am

Nice guide. I too love sshfs.

Since your link to your mount.fuse is dead, here’s an easy way to gain mount.fuse in the path for your readers:

sudo ln -s /usr/bin/fusermount /sbin/mount.fuse

Brian ViselDecember 2nd, 2006 at 5:10 pm

..mount.fuse is a broken link.. Thanks, though..

JohnDecember 4th, 2006 at 11:05 am

So it is, fixed now though.

JeremyJanuary 24th, 2007 at 5:24 pm

Ubuntu 6.10
While looking in to this, i noticed that in /sbin, where you say to put your script, there was a broken link for mount.ntfs-fuse, pointing to /usr/sbin/ntfsmount.

A locate of ntfsmount showed that it existed in /usr/bin/ntfsmount, so i simply made a link

ln -s /usr/bin/ntfsmount /usr/sbin/ntfsmount

which fixed the broken link, and now my fstab file works just fine with a mount type of ntfs-fuse (as shown in the man example).

Thought i would share. :)

JohnJanuary 25th, 2007 at 11:00 am

I don’t think I mentioned ntfs anywhere actually!

Moritz BellerFebruary 1st, 2007 at 3:41 pm

Thanks! The mount.fuse script is indeed missing.

SebFebruary 22nd, 2007 at 8:28 pm

Thanks. I upgraded Ubuntu to vers. 6.10 … then, automount via fstab didnt work anymore. your thread was exactly what I was looking for. grande!

Leave a comment

Your comment