乐云主机笔记

  • 首页
  • 学习记录
  • 资源下载
  • 新手教程
  • 其他
  • 脚本源码
  • 自用主机
  • 主机优惠
  • 域名优惠
  • 网赚项目

  1. 首页
  2. 学习记录
  3. 正文

debian下挂载webdav(以stackstorage为例)的方法

2019年 10月 8日 3267点热度 1人点赞 0条评论

安装和尝试挂载

apt-get install davfs2
mkdir /www/wwwroot/挂载目录
mount -t davfs https://username.stackstorage.com/remote.php/webdav /www/wwwroot/挂载目录
#Please enter the username to authenticate with server
#https://username.stackstorage.com/remote.php/webdav or hit enter for none.
  Username: test
#Please enter the password to authenticate user test with server
#https://username.stackstorage.com/remote.php/webdav or hit enter for none.
  Password:

 


提示server does not support WebDAV错误

  1. davfs2 提供了通过配置文件禁用 WebDAV 头检测的功能,直接修改 /etc/davfs2/davfs2.conf 配置文件注释并改为:
  2. ignore_dav_header 1
  3. 然后再重新使用 mount 或者 mount.davfs 命令挂载坚果云就可以成功了

指令

 df -h

显示如下挂载成功

设置指定账户,方便挂载

首先启用用户锁,操作方式如下:

vi /etc/davfs2/davfs2.conf

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

images

然后再修改帐密文件,操作方式如下:

echo "https://username.stackstorage.com/remote.php/webdav username password" > /etc/davfs2/secrets

然后 umount /挂载目录 把刚刚挂载的分区卸载掉,然后直接再次挂载的时候就无需密码了。debian9开机挂载

开机启动自动挂载

dibian9及更早:添加/etc/rc.local

 

为了解决这个问题,我们需要手工添加一个 /etc/rc.local 文件

cat <<EOF >/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

EOF

赋予权限

chmod +x /etc/rc.local

启动 rc-local 服务

systemctl start rc-local

添加命令启动

mount -t davfs https://username.stackstorage.com/remote.php/webdav /www/wwwroot/挂载目录


debian10-12:修改FSTAB

nano /etc/fstab

增加挂载指令后保存

https://username.stackstorage.com/remote.php/webdav  /www/wwwroot/挂载目录/  davfs defaults 0 0

标签: 开机启动
最后更新:2024年 9月 6日

wangzhe12588

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2025 年 5 月
  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 7 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 12 月
  • 2023 年 11 月
  • 2023 年 10 月
  • 2023 年 9 月
  • 2023 年 8 月
  • 2023 年 7 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 3 月
  • 2023 年 2 月
  • 2023 年 1 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2021 年 3 月
  • 2021 年 2 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 8 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 4 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2020 年 1 月
  • 2019 年 12 月
  • 2019 年 11 月
  • 2019 年 10 月
  • 2019 年 9 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 6 月
  • 2019 年 5 月
  • 2019 年 4 月
  • 2019 年 3 月
  • 2019 年 2 月
  • 2019 年 1 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 10 月
  • 2018 年 9 月
  • 2018 年 8 月
  • 2018 年 7 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 10 月
  • 2017 年 9 月
  • 2017 年 8 月
  • 2017 年 7 月

分类

  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3