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
相关推荐
森语林溪1 小时前
大数据环境搭建从零开始(十四)CentOS 7 系统更新源更换详解:阿里云镜像源配置完整指南
大数据·linux·运维·阿里云·centos
csdn_aspnet3 小时前
如何在 Mac、Ubuntu、CentOS、Windows 上安装 MySQL 客户端
linux·windows·mysql·macos·centos
guygg884 小时前
Rocky Linux 8.9配置Kubernetes集群详解,适用于CentOS环境
linux·kubernetes·centos
csdn_aspnet4 小时前
CentOS 7 上安装 MySQL 8.0
linux·mysql·centos
森语林溪6 小时前
大数据环境搭建从零开始(十七):JDK 17 安装与配置完整指南
java·大数据·开发语言·centos·vmware·软件需求·虚拟机
zdslovezy19 小时前
CentOS 系统升级 OpenSSH 和 OpenSSL 的完整方案
linux·运维·centos
IT 小阿姨(数据库)1 天前
PostgreSQL 之上的开源时序数据库 TimescaleDB 详解
运维·数据库·sql·postgresql·开源·centos·时序数据库
一叶知秋yyds1 天前
Centos 安装 Docker教程
linux·docker·centos
fie88891 天前
在CentOS 7上集成cJSON库的方法
linux·运维·centos
做运维的阿瑞2 天前
CentOS DNS故障排查完整解决方案:从症状到根因的系统化诊断
linux·运维·centos