Skip to content

Instantly share code, notes, and snippets.

@matthijs166
Created July 19, 2018 15:08
Show Gist options
  • Save matthijs166/2e58b57565ae08ccf63a03f938ee7dcc to your computer and use it in GitHub Desktop.
Save matthijs166/2e58b57565ae08ccf63a03f938ee7dcc to your computer and use it in GitHub Desktop.
add webdav mount to ubunut in mnt
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”.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment