With the continuous technology innovation, you can now mount WebDAV to Linux and have an efficient file management system that enables you to edit files and other web resources on remote servers. You can have easy access for authoring content in different locations.

Linux WebDAV Mount

If you want to mount WebDAV in Linux, you can follow these steps:

Davfs2 installation

# sudo apt -get install
davfs2
Davfs2 reconfiguration to enable the davfs use for unprivileged users
#sudo dpkg-reconfigure
davfs2
Edit /etc/davfs2/davfs2.conf into enable automatic credentials use
Uncomment the line secrets
~/.davfs2/secrets
Edit ~/.davfs2/secrets file for adding credentials on remote WebDAV directory.
Add a line on the end of the file with this style:
https://<WebDav URI>
<username> <password>

Set the permission:

# chmod
600~/.davfs2/secrets
Add line to /etc/ fstab about the remote WebDAV directory
https://<WebDav URI>
<mount point>
Davfs user, noauto, file_m
ode =600 , dir_mode=700 0 1
Add your user on the davfs2 group
#sudo v1 / etc/group
Add your username as follows:
Davfs2:x:134:<username>

WebDAV Linux Mount without Root User

WebDAV Linux Mount
By following these steps, you can now use these Linux commands without the need of being the root user to mount/umount:

# mount <mount point>
#umount <mount point>
You can also use the nautilus to mount or umount the directory.
Mounting through root
Sudo mount.davfs -o users, uid =systemuser, username = webdavuser http://foo.bar/folder / home/systemuser/folder

Mounting through user and password prompt

sudo echo http://foo.bar/folder davfs2 defaults, noauto 0 0 “ >> / etc/fstab
mount.davfs – 0 users, uid=systemuser, username= webdavuser / home/ user/ folder
Mounting through user without a password prompt
sudo echo http://foo.bar/folder davfs2 defaults, noauto 0 0 “ >> /etc/fstab
echo http://foo.bar/folder webdavusername webdavpassword >> / home/ systemuser/.davfs/ secrets (or/ etc/davfs2/secrets)
mount.davfs -o users, uid=systemuser / home/user/folder

Actual Linux WebDAV Mount implementation requirements

learn linux webdav mount

Linux OS
Adminpermission

Authorization adjustments on OS:
sudo groupadd powerfolder
sudo gpasswd – a < OS USERNAME> powerfolder
sudo visudo -f /etc/sudoers.d/powerfolder
Insert this line in the opened file: “%powerfolder ALL = NOPASSWD:/bin/ mount, / sbin/mount.davfs, /bin/umount”
Re-login to your system
WebDAV URL notation: ‘ <PROTOCOL> :// <USERNAME> :<PASSWORD>@WEBDAVRESOURCE> ‘ E.g. https://[email protected]: FooBar123! @my.powerfolder.com/webdav/Test
Packages to install: davfs, sudo, bash, pkexec
Installation of the required software

You must install davfs2 package if you want to mount WebDAV resource as you regular file system.
$ sudo apt-get install davfs2
Mount WebDAV share with the use of command-line
You can do this by creating mountpoint directory.
$ sudo mkdir/ mnt/dav

Use mount command in mounting WebDAV share.
$ sudo mount – t davfs -o noexec https://nextcloud.example.com/remote.php/webdav/ /mnt/dav/

You can also use umount command if you want to unmount the WebDAV share.
$ sudo umount/ mnt/ dav
/sbin/mount.davfs: waiting while mount. davfs (pid 1475) will synchronize the cache. OK

Mount WebDAV share with fstab – Create fstab entry for letting specified users to mount the file system.

$ cat << EOF | sudo tee -a /etc/fstab
# personal webdav
https:/Nextcloud.example. com/ remote.php/webdav/ / mnt/dav davfs_netdev, noauto, user, uid=milosz, gid=Milosz 0 0 EOF

With these extensive steps, you can now use the Linux WebDAV Mount and enjoy its features for your file management system.