首页 > 其他分享 >Debian挂载Web-DAV

Debian挂载Web-DAV

时间:2023-07-25 09:44:52浏览次数:39  
标签:Web secrets davfs2 etc DAV https 挂载 novos Debian

 ----------------------------------------------------------

 第一种方案

=====================================

 1.安装davfs2:

apt-get install davfs2  -y     2.配置davfs2: 在/etc/davfs2/secrets中添加如下一行即可: "http://127.0.0.1:9001/"  admin  admin   3.挂载到本地磁盘: mount.davfs http://127.0.0.1:9001/   /home ----------------------------------------------------------

第二种方案

=====================================

安装和尝试挂载

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

 ----------------------------------------------------------

第三种方案

=====================================

一、最简单的挂载支持WebDav的网盘

1、安装davfs2

Ubuntu/Debian下

apt-get install davfs2

CentOS下

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

标签:Web,secrets,davfs2,etc,DAV,https,挂载,novos,Debian
From: https://www.cnblogs.com/merrynuts/p/17578915.html

相关文章

  • 我开源了团队内部基于SpringBoot Web快速开发的API脚手架v1.6.0更新
    什么是rest-api-spring-boot-starterrest-api-spring-boot-starter适用于SpringBootWebAPI快速构建让开发人员快速构建统一规范的业务RestFullAPI不在去关心一些繁琐。重复工作,而是把重点聚焦到业务。动机每次WebAPI常用功能都需要重新写一遍。或者复制之前的项目代码......
  • WEB漏洞—文件操作之文件下载读取
    文件下载,读取原理,检测,利用,修复等#利用数据库配置文件下载或读取后续接口密匙信息文件下载或读取后续#文件名,参数值,目录符号read.xxx?filename=down.xxx?filename=readfile.xxx?file=downfile.xxx?file=../..\.\./等%00?%23%20.等&readpath=、&filepath=、&......
  • 老杜 JavaWeb 讲解(十四) ——JSP+Servlet改造oa项目
    (十四)JSP改造oa项目相关视频:38-Servlet和JSP改造oa项目使用Servlet+JSP完成oa项目的改造使用Servlet处理业务,收集数据。使用JSP展示数据。将之前原型中的html文件,全部修改为jsp,然后在jsp文件头部添加page指令(指定contentType防止中文乱码),将所有的JSP直接拷贝到web......
  • 协议 tcp rpc http websocket
    传输层:tcp,udp应用层:http,grpc,websocket浏览器服务器太多了,互相沟通需要统一的协议,http主要用于B/S如果是公司内部,轻量小巧定制化,用rpchttp是半双工,同一时间,只能一方发送消息,客户发送请求,建立http连接后,通过header可以申请升级到websocket协议 待补充wireshark的抓包分析:......
  • 适用于Android手机的Debian GNU/Linux和Windows兼容环境
    Github地址:https://github.com/jinshulumengchuang/Debian-Wine-Android食用方法:从github下载release安装得到的apk文件把tarball放在内部存储的根目录给termux存储权限打开termux输入:cd..;tarxvf/sdcard/rootfs.tar.xz回车等候指令执行完成.($符号重新出现)......
  • 【网络编程】基础知识(Web Server和HTTP协议)
    WebServer一个WebServer就是一个服务器软件(程序),或者是运行这个服务器软件的硬件(计算机)。其主要功能是通过HTTP协议与客户端(通常是浏览器(Browser))进行通信,来接收,存储,处理来自客户端的HTTP请求,并对其请求做出HTTP响应,返回给客户端其请求的内容(文件、网页等)或返回一个Error......
  • 基于web的网上书城系统
    完整资料进入【数字空间】查看——baidu搜索"writebug"一、摘要随着前端各种新兴技术的崛起,我们编写前端已经不仅仅局限于html,css,js,而是有了更多的选择,用更加简洁的代码就可以实现更加完美的功能。“基于web的网上书城系统”的前端开发就是采用vue和基于vue开发的桌面组件库element......
  • CTFer成长记录——CTF之Web专题·bugku-啊哒
    一、题目链接  https://ctf.bugku.com/challenges/detail/id/6.html?id=6二、解法步骤  打开图片:  显示完整,似乎没有文件高度的问题。右键查看属性——>文件详细信息:发现一串16进制数:尝试转换成字符串:https://www.sojson.com/hexadecimal.html  得到:sdnisc_20......
  • CTFer成长记录——CTF之Web专题·bugku-眼见非实
    一、题目链接  https://ctf.bugku.com/challenges/detail/id/5.html二、解法步骤  解法压缩包是一个.docx文件,打开该文件后发现一堆乱码:  结合题意:“眼见非实”,猜测该docx文件融合了其他的文件。用010打开看看:  发现了压缩包的文件头,于是用binwalk尝试文件拆分:binwal......
  • Vue WebSocket的实现 含断线重连
    vue客户端 main.jsimport{createApp}from'vue'import{reactive}from'vue'importAppfrom'./App.vue'import{webSocketUrl}from'/public/static/config.json'letwebsock=null;constapp=createApp(App);......