Map owncloud share in linux using webdav

Install davfs2
apt-get install davfs
Reconfigure davfs2 to allow access to other users (select ‘yes’ when prompted).
dpkg-reconfigure davfs2

Add users you want to be able to mount the share (where USER is the username)
usermod -aG davfs2 USER

Create a mountpoint
mkdir /mnt/owncloud
Mount the WebDav ownCloud
mount -t davfs https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud
If your owncloud installation is in a directory other than ‘owncloud’ substitute it above. I used HTTPS which will encrypt communication and credentials but HTTP can also be used but obviously is higher risk.
Credentials can be automatically supplied by adding them to the following files
system wide /etc/davfs/secrets
individually ~/.davfs2/secrets
Edit either file using nano and add
https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud USERNAME PASSWORD
To mount on boot add the following to fstab
https://owncloud_address_or_ip/owncloud/remote.php/webdav /mnt/owncloud davfs2 user,auto 0 0
(using noauto instead of auto will prevent it beingmounted automatically so choose depending on your enviroment)
To manually mount use
mount /mnt/owncloud
To unmount use
umount /mnt/owncloud
When I tried to create a test file on the shared I got the following error
touch: setting times of ‘test’: No such file or directory
To fix this edit your /etc/davfs2/davfs2.conf file and change/uncomment the ‘use_locks’ parameter to
use_locks 0

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *