一、安装 davfs2

[root@HZ-Ali]# yum install davfs2

二、挂载

1、新建挂载位置

[root@HZ-Ali]# mkdir -p guazai
[root@HZ-Ali]# ls
guazai  lost+found
[root@HZ-Ali]# chmod +x guazai

2、尝试挂载

[root@HZ-Ali]# mount -t davfs http://192.168.8.102:25244/dav guazai
Please enter the username to authenticate with server
http://192.168.8.102:25244/dav or hit enter for none.
  Username: admin
Please enter the password to authenticate user admin with server
http://192.168.8.102:25244/dav or hit enter for none.
  Password:  
/sbin/mount.davfs: Warning: can't write entry into mtab, but will mount the file system anyway

3、将挂载用户名和密码写入/etc/davfs2/secrets

编辑

[root@HZ-Ali]# vi /etc/davfs2/davfs2.conf 

找到“use_locks”,去掉前面的 # 然后把 1 改为 0 后保存

然后添加账号密码文件,操作方式如下:

cp /etc/davfs2/secrets /etc/davfs2/secrets.bk
echo "http://192.168.8.102:25244/dav admin admin123" >> /etc/davfs2/secrets

三、设置开机启动

chmod +x /etc/rc.d/rc.local

如没有则新建

vim /etc/rc.d/rc.local

添加

mount -t davfs http://192.168.8.102:25244/dav /data/guazai

有可能开机后还是没有 mount, 执行一下 mount -t davfs http://192.168.8.102:25244/dav /data/guazai