centos安装rclone挂载alist

一、安装alist

1.通过docker启动alist

bash 复制代码
docker run -d --restart=always \
  -v /usr/local/docker/alist/data:/opt/alist/data \
  -p 5244:5244 \
  -e PUID=$(id -u) \
  -e PGID=$(id -g) \
  -e UMASK=022 \
  --name alist \
  xhofe/alist:latest

2.访问alist

使用docker logs alist在容器日志中找到密码,访问http://IP:5244,登陆后可以修改密码

二、安装rclone

1.这里推荐在线安装,如果提示未安装unzip则安装重试

bash 复制代码
curl https://rclone.org/install.sh | sudo bash

2.验证,出现版本号即可

bash 复制代码
rclone --version

3.配置rclone通过webdav挂载alist

bash 复制代码
rclone config

这里会有11步交互的配置操作,我简单写一下每一步:

1.是否选择新远程,选n
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
2.设置名字
name> rclone-alist
3.选择协议类型,这里我省略选项,输入webdav或输入前面的数字,我这是52
Type of storage to configure.
Choose a number from below, or type in your own value
//...
Storage> 52
4.输入webdav链接地址,即alist的webdav地址
Option url.
//...
url> http://127.0.0.1:5244/dav
5.选择webdav服务提供者的名字,选带Other的字段,我这是7
Name of the WebDAV site/service/software you are using
Choose a number from below, or type in your own value
//...
vendor> 7
6.输入webdav链接账号
Option user.
//...
user> admin
7.输入webdav连接密码,先选y,再输入两次密码
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y
Enter the password: 
password:
Confirm the password: 
password:
8.不输入Bearer token,直接回车
Bearer token instead of user/pass (e.g. a Macaroon)
bearer_token>
9.是否编辑高级配置,默认是n直接回车
Edit advanced config?
y) Yes
n) No (default)
y/n> 
10.配置完成,是否保持当前远程?默认y直接回车
//...
Keep this "rclone-alist" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
11.至此显示出当前远程仓库,选q退出当前配置模式
Current remotes:
Name                 Type
====                 ====
rclone-alist         webdav
//...
e/n/d/r/c/s/q> q

如果要修改配置,该文件在路径:/root/.config/rclone/rclone.conf

4.查看是否挂载成功

1.执行命令,成功则会显示alist中的目录

bash 复制代码
rclone lsd rclone-alist:/

5.安装fuse

1.fuse用于将rclone挂载的目录挂载到本地磁盘,在高版本rclone中需要安装fuse3

bash 复制代码
yum -y install fuse3

三、挂载到本地磁盘

1.根目录新建用于挂载到目录

bash 复制代码
mkdir /rclone_root

2.执行命挂载到新建的目录(可以将该命令设为开机启动执行即自动挂载)

bash 复制代码
rclone mount rclone-alist: /rclone_root --copy-links --allow-other --allow-non-empty --umask 000 --daemon

执行成功后会返回rclone挂载的pid,此时rclone_root 目录下就能看到挂载的alist目录

3.取消挂载

bash 复制代码
fusermount -qzu /rclone_root
相关推荐
学习3人组5 小时前
CentOS 中配置 OpenJDK以及多版本管理
linux·运维·centos
黎相思11 小时前
操作系统迁移(CentOs -> Ubuntu)
linux·ubuntu·gitee·centos
学习3人组17 小时前
克隆centos网卡uuid相同如何修改
linux·运维·centos
【D'accumulation】17 小时前
配置RHEL和centOS的阿里云镜像源
linux·阿里云·centos
Flying_Fish_roe20 小时前
linux-软件包管理-包管理工具(RedHat/CentOS 系)
linux·运维·centos
Splashtop高性能远程控制软件20 小时前
centos远程桌面连接windows
linux·windows·centos·远程控制·远程桌面
Roc-xb21 小时前
如何在 CentOS 上安装和使用 Neofetch(图文教程)
linux·运维·centos
程序员大阳21 小时前
Linux(6)--CentOS目录
linux·centos·目录
学习3人组1 天前
CentOS 上配置多服务器 SSH 免密登录
服务器·centos·ssh
剩下的远方1 天前
CentOS7 MySQL8.0 启动失败 Data Dictionary initialization failed
运维·mysql·centos