乐云主机笔记

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

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

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

2019年10月8日 2103点热度 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:

指令

 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开机挂载

添加/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/挂载目录

 

标签: 开机启动
最后更新:2020年6月28日

letvps

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

打赏 点赞
< 上一篇
下一篇 >

文章评论

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

分类
  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载
书签
  • AdvinServers.com
  • 猫云云计算

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3