• Tutorial: how to automatically mount WebDAV shares at boot in Linux

    In Ubuntu (and Kubuntu or Lubuntu) you can quite easily access a WebDav (or WebDavs) share using the standard file manager: Nautilus, Konqueror or PcManFm.

    Just put in the address bar the site you want to open (for example: davs://yoursitename or webdav://yoursitename) and click on enter… That’s it (probably you will be asked for credentials – just put the right ones there…)!

    To make it work you only need to know if the connection is secure (davs) or not (webdav) and if the package davfs2 is installed (open a terminal and type “sudo apt-get install davfs2”).

    However in some cases you may want to have this share always mounted in your system and without the need to put credentials. If this is your case, the solution is pretty easy:

    Create a folder on your disk into which the web share will be mounted:
    sudo mkdir /mnt/sharename

    sudo nano /etc/davfs2/secrets

    add the line:
    https://www.yourshare.com username password

    and now you need to make sure the connection is made each time you start your computer:

    sudo nano /etc/fstab

    at the end of the file, on a new line type:

    https://www.yourshare.com/ /mnt/sharename    davfs   defaults,uid=username,gid=username,_netdev,auto  0       0

    Please note the options uid and gid, these are used to tell to the system which user will be able to write to the share (normally is root). In this case “username” is the one you use on your computer.
    The option “_netdev” tells to the system to wait for the connections to be up before attempting to mount the share (otherwise it will fail). The mount will happen automatically, as requested by the option “auto”.