发布于  更新于 

rclone挂载alist 115等网盘到本机

1.前言

本文介绍了使用rclone挂载alist里的网盘资源到本地的方法。

2.什么是rclone

Rclone是一个开源、多线程、命令行界面的计算机程序,可用于管理云存储。其功能包括档案同步、文件传输、加密、缓存和挂载。rclone支持包括Amazon S3和Google 云端硬盘在内等共五十多种云存储服务。

3.安装rclone

以macOS为例,其他类Unix系统操作同理。
Rclone官网下载

4.配置rclone

进入终端:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
rclone config
# 选择新远程
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n #选择n
# 设置名字
name> alist #以alist为例
Type of storage to configure.
Choose a number from below, or type in your own value
[snip]
XX / WebDAV
\ "webdav"
[snip]
Storage> webdav #输入webdav
# 设置远程地址url http://your_alist_ip:port/dav
URL of http host to connect to
Choose a number from below, or type in your own value
1 / Connect to example.com
\ "https://example.com"
url> http://127.0.0.1:5244/dav #这里设置alist的地址和端口,后面要带dav,http://#.#.#.#:5244/dav/,#号记得替换为ip
# 这里选6 选择带有other的字段
Name of the WebDAV site/service/software you are using
Choose a number from below, or type in your own value
1 / Fastmail Files
\ (fastmail)
2 / Nextcloud
\ (nextcloud)
3 / Owncloud
\ (owncloud)
4 / Sharepoint Online, authenticated by Microsoft account
\ (sharepoint)
5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ (sharepoint-ntlm)
6 / Other site/service or software
\ (other)
vendor> 6
# 设置远程账号
User name
user> admin #alist的账号
# 设置远程密码
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y #这里输入y
Enter the password: #输入alist密码
password:
Confirm the password: #再次输入密码
password:
# 直接回车,不用管
Bearer token instead of user/pass (e.g. a Macaroon)
bearer_token>

Edit advanced config?
y) Yes
n) No (default)
y/n> n #选择n

#后面一直回车
# 你的远程信息
--------------------
[remote]
type = webdav
url = http://#.#.#.#:5244/dav/
vendor = Other
user = admin
pass = *** ENCRYPTED ***
--------------------
# 确认
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y #输入y
# q退出

4.1验证

通过rclone config查看:

通过rclone lsd alist:查看,出现alist中挂载的目录说明配置成功:

5.挂载网盘

本地新建文件夹名为alist,终端输入:

5.1前台模式挂载

1
rclone mount alist:/ /Users/cl261077486/alist --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --use-mmap

/Users/cl261077486/alist为本地创建的alist文件夹路径

5.2后台守护进程模式挂载(推荐)

1
rclone mount alist:/ /Users/cl261077486/alist --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --use-mmap --daemon

实测macOS使用该方式挂载会出现ERROR : Daemon timed out. Failed to terminate daemon pid 33714: os: process already finished错误,github issue中的解决方法是使用前台模式挂载暂用着。

6.本地效果