Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

With FUSE it is possible to mount many things purely as a non privileged user. However, it seems that for webdav davfs2 is the preferred project, which appears to be a filesystem driver and uses the standard mount/umount which requires privileges.

Is there a way to use this (or another library) to mount webdav only as a user via fuse ? (i.e. so each user could mount a different webdav on a different server, without needing to configure anything in fstab etc).

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I was able to use wdfs to make it work as a non priv. user:

 wdfs <dav url> <mount point>

To unmount

fusermount -u <mount point>

wdfs is from here and uses fuse. I use Archlinux and this AUR package worked fine

share|improve this answer
    
This rocked my world. wdfs is such an awesome program! Thank you very much for the recommend! –  hopeseekr Jun 25 at 17:03
    
Glad you enjoyed it (I barely remember this, but I love that serverfault remembers it for me). –  Michael Neale Jun 25 at 23:22

As a starter answer.. I would suggest the following.

1) sshfs doesn't require access to the /etc/fstab, so if you can map your webdav users onto linux users with similar file structure, then that is a simple alternative.

Then you can use non-root syntax like this to mount within your local home directory;

sshfs -o ControlPath=none -o workaround=rename -o idmap=user \
-o nonempty -o reconnect -o transform_symlinks -o follow_symlinks"   \
userXXX@my.ssh.server.com:/ $HOME/mnt/my.ssh.server.com

2) gvfs/gio - Depending on your distro, /usr/libexec/gvfsd-dav might be an option, which should allow an alternative control syntax to mount the webdav filesystem under ~/.gvfs/

However the documentation is pretty rubbish, and I've only made a limited test of its functionality like so;

As root;

sudo yum install gvfs-fuse.x86_64

then as a user;

$ gvfs-mount dav://my.dav.server.hostname.com/projects/
Enter password for Authorization Realm
User: my.dav.username
Password: XXXXXX

$ cd ~/.gvfs/WebDAV\ on\ my.dav.server.hostname.com/

$ ls 
proj1
proj2
proj3
...
etc
share|improve this answer
    
yes, the sshfs looks great - for ssh, it almost seems as if it was a step backwards for davfs2 to use regular mounting (but it does make it easy when you don't want to do it in user space - just another file system) –  Michael Neale May 23 '12 at 8:52
    
hmm. I am having trouble getting a gvfs to mount a webdav on my headless CentOS test box... sudo yum install gvfs-fuse.x86_64 and then gvfs-mount dav://my.dav.server.hostname.com/projects/ is giving Error mounting location: volume doesn't implement mount –  Tom H May 23 '12 at 8:58
    
but it works fine in userspace on my local fedora, maybe its missing some library that implements that userspace mount option –  Tom H May 23 '12 at 8:59
    
yes I am using Arch linux, and see the same - "doesn't implement mount". gvfs does seem "shady" - a lot of dependencies came with it. davfs2 seems the appropriate way and works well, but alas is not user space purely. Oh well. If you find any more out, please make a note here ! –  Michael Neale May 23 '12 at 22:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.