More about open source software
Most admins know WebDAV, but davfs2 isn’t as well known. With this open source software tool, you can connect to WebDAV server as a regular filesystem, thus allowing applications that don’t support WebDAV to access shared resources via WebDAV.
I had a request this week to check out davfs2. This neat open source utility allows you to connect to a WebDAV server as a regular filesystem, meaning that applications that don’t support WebDAV can still access resources shared via WebDAV. Basically, it provides another protocol for mount to use.
davfs2 is available as a Debian/Ubuntu package, so it’s easy to install with apt-get install davfs2. Once installed, you can connect via the commandline straight away, if you have sudo access:
|
|---|
This will mount the specified WebDAV share at /mnt. You’ll be asked for the username and password to connect with, if the share is secured. When you’re done, unmount with
sudo umount /mntThis isn’t entirely convenient, though; it’s better to be able to mount the directory as a normal user. Edit
/etc/fstabto set up a mountpoint by adding a line like this:
|
|---|
You’ll need to create the mountpoint with
|
|---|
if it doesn’t already exist.
If you try running mount
/home/juliet/mnt/webdavnow, as a non-root user, you’ll be told that
/sbin/mount.davfsis not setuid root. Fix this by running
|
|---|
and answering ‘yes’ to the setuid question. You’ll also need to add your user to the davfs group (either
edit /etc/groupor use sudo gpasswd -a username davfs). Log out and in again to update the group information.
Now try mount
~/mnt/webdavagain. You’ll be challenged for the username and password (if the share is protected), after which you should be able to access your directory just as you would any other mounted directory.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of “Linux System Administration Recipes: A Problem-Solution Approach” (Apress, 2009).