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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM