Linux挂载webdav

Docker挂载webdav(推荐):

docker run -itd  \
    --name mydav \
    --device /dev/fuse \
    --cap-add SYS_ADMIN \
    --security-opt "apparmor=unconfined" \
    --env "WEBDRIVE_USERNAME=用户名" \
    --env "WEBDRIVE_PASSWORD=密码" \
    --env "WEBDRIVE_URL=http://172.17.0.5:48080/remote.php/dav/files/eric/" \
    --env "DAVFS2_ASK_AUTH=0" \
    -v /mnt/dav:/mnt/webdrive:rshared \
    efrecon/webdav-client
	

传统挂载webdav

安装所需软件包:apt-get install davfs2 -y

创建挂载目录:mkdir /mnt/dav

挂载:mount -t davfs -o noexec https://nextcloud.example.com/remote.php/webdav/ /mnt/dav/

卸载:umount /mnt/dav

保存账号密码:

cat << EOF | sudo tee -a /etc/davfs2/secrets
# personal webdav, nextcloud application password
/mnt/dav milosz mypassword
# older versions used URL, it is equivalent for compatibility reasons
#https://nextcloud.example.com/remote.php/webdav/ milosz mypassword
EOF

开机自动挂载:

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
posted @ 2021-10-27 11:45  秒年度  阅读(6611)  评论(0编辑  收藏  举报