一、最簡單的掛載支持WebDav的網盤
1、安裝davfs2
apt-get install davfs2
yum install davfs2
2、創建目錄并掛載
mkdir /novos mount -t davfs https://brick.novos.be/remote.php/dav/files/賬號/ /novos
輸入賬號、密碼即可。
二、進階用法
1、創建一個用戶,用于davfs2
usermod -aG davfs2 用戶名
2、創建需要掛載的目錄和個人配置文件目錄
mkdir ~/novos mkdir ~/.davfs2
復制配置文件
cp /etc/davfs2/secrets ~/.davfs2/secrets
3、設置用戶權限(改為自己的用戶名)
chown : ~/.davfs2/secrets chmod 600 ~/.davfs2/secrets
編輯 ~/.davfs2/secrets ,輸入WebDav網盤信息,如:
https://brick.novos.be/remote.php/dav/files/賬號/ 用戶名 密碼
建議在 /etc/davfs2/secrets 也添加上
4、添加mount信息到 /etc/fstab
https://brick.novos.be/remote.php/dav/files/賬號/ /root/novos davfs user,rw,auto 0 0
5、使用
添加
mount ~/novos
卸載
umount ~/novos