How do I make a webDAV share mountable, so that is available for all users? without having to type in a password.
1 Answer
Create a directory that you want to use as your mount point, for example myserver
:
sudo mkdir /media/myserver
Add the following line to /etc/fstab
:
myserverip /media/myserver/ davfs noauto,user,rw 0 0
Change myserverip
to the IP address or domain name and port of your webDAV server.
Open ~/.davfs2/secrets
(per user) or /etc/davfs2/secrets
(system wide) and find the credential line section, now add a line with the server ip, the username you need to login to the webDAV share and the password in the following order:
myserverip webdavusername webdavpassword
Set the correct permissions on ~/.davfs2/secrets
or /etc/davfs2/secrets
:
chmod 600 ~/.davfs2/secrets
or
sudo chmod 600 /etc/davfs2/secrets
run sudo dpkg-reconfigure davfs2
and select yes to allow mounting by non-root users.
check that in /etc/davfs2/davfs2.conf
you have:
dav_user davfs2 # system wide config file only
dav_group davfs2 # system wide config file only
add your user (my username in this example) to the davfs2 group:
sudo usermod -aG davfs2 myusername
You can check that it you have been added to the group by running groups myusername
:
myusername : myusername davfs2
Reboot or log out to let the group changes come in effect.
You should now be able to mount your share by clicking on it in your file browser.