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
相关推荐
My is 李豆1 小时前
CentOS 7 安装 Docker 完整教程(含 docker-compose 插件)
docker·eureka·centos
上天_去_做颗惺星 EVE_BLUE5 小时前
【新 Linux 服务器上手全攻略】系统巡检、存储规划与开发环境初始化
linux·运维·服务器·ubuntu·macos·centos
2601_961194029 小时前
考研专业课在哪里参加考试|考点|流程|资料已整理
linux·考研·ubuntu·缓存·centos·负载均衡
我叫张小白。1 天前
CentOS 7 安装 Docker并配置镜像加速(完整指南)
linux·docker·centos
paul_chen212 天前
CentOS 8 LVM 在线扩容根分区:从 home 安全割让空间(XFS 文件系统)
linux·安全·centos
流烟默3 天前
腾讯云Centos7.6使用yum安装MySQL8
mysql·centos·腾讯云
穿条秋裤到处跑4 天前
Centos7环境升级openssh7.4p1至openssh9.8p1版本
centos·openssh
阳光满路4 天前
三步搞定:Linux 安装配置 Telnet 服务
linux·运维·centos
张青贤4 天前
centos7内核kernel升级
linux·centos·内核·kernel
whlqjn_12114 天前
Centos9用dnf安装rt实时内核
centos