创建一个加密的Rclone远程以加密云存储文件

1.打开终端,然后键入以下内容以创建“ crypt” Rclone远程服务器。

rclone config

然后,系统将询问您接下来要做什么。

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n

进入 n 创建一个新的遥控器。
2.接下来,将要求您输入新的遥控器I的名称。 encrypted 名称:

name> encrypted

3.接下来,您需要选择要配置的存储类型。

Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
..............
10 / Encrypt/Decrypt a remote
    "crypt"
........
Storage> crypt

类型 crypt 创建一个新的加密存储类型。
4.接下来,您需要输入远程路径进行加密/解密。例如,如果您创建一个名为OneDrive的遥控器 onedrive,并且您想要加密的内容 Backups 此OneDrive遥控器中的文件夹,使用 onedrive:Backups 这里:

Remote to encrypt/decrypt.
Normally should contain a ':' and a path, eg "myremote:path/to/dir",
"myremote:bucket" or maybe "myremote:" (not recommended).
Enter a string value. Press Enter for the default ("").
remote> onedrive:Backups

您在此处输入的路径中的所有内容都会被加密,外部的所有内容都不会被加密。
如果您不知道如何调用云存储远程服务器,可以打开一个终端并输入该终端以列出在Rclone中配置的所有远程服务器。

rclone listremotes

5.下一步是选择如何加密文件名,您可以选择使用标准的简单文件名混淆,也可以选择不加密文件名。请注意,标准文件名加密会生成更长的文件名,并且某些云存储提供商可能会对文件名长度有所限制。选择最适合您需求的选项(我选择了以下标准)。

How to encrypt the filenames.
Enter a string value. Press Enter for the default ("standard").
Choose a number from below, or type in your own value
 1 / Encrypt the filenames see the docs for the details.
    "standard"
 2 / Very simple filename obfuscation.
    "obfuscate"
 3 / Don't encrypt the file names.  Adds a ".bin" extension only.
    "off"
filename_encryption> standard

6.在下一步中,您还可以选择加密目录名称(类型 true 要么 1),或不理会(类型 false 要么 2):

Option to either encrypt directory names or leave them intact.
Enter a boolean value (true or false). Press Enter for the default ("true").
Choose a number from below, or type in your own value
 1 / Encrypt directory names.
    "true"
 2 / Don't encrypt directory names, leave them intact.
    "false"
directory_name_encryption> true

7.接下来,系统将提示您为加密的云存储文件输入密码或生成随机密码。请记住该密码。密码存储在Rclone配置文件中(您可以对其进行加密,如稍后所述),因此您不必在每次访问加密文件时都输入密码,以防万一您丢失了Rclone配置您需要此密码才能解密您的云存储文件。
我的密码 (y),在这种情况下,我必须输入两次密码。

Password or pass phrase for encryption.
y) Yes type in my own password
g) Generate random password
y/g> y

Enter the password:
password:
Confirm the password:
password:

8.然后输入盐密码(或生成随机密码)或将其保留为空白。 Rclone与scrypt结合使用第二个密码,因此对Rclone加密的数据发起字典攻击是不现实的。我们建议设置密码以提供全面保护。
我进入这里 g,告诉Rclone生成一个随机密码。

Password or pass phrase for salt. Optional but recommended.
Should be different to the previous password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank (default)
y/g/n> g

9. Rclone将生成一个密码,然后将提示您输入密码强度。建议使用1024,以获得最大的密码强度。

Password strength in bits.
64 is just about memorable
128 is secure
1024 is the maximum
Bits> 1024

10. Rclone显示生成的密码,并询问您是否要使用该密码(键入 y 或者按 Enter 如果新密码确定,则输入密钥)。请再次记住该密码。请将其保存在安全的地方,例如密码管理器(建议使用Bitwarden)。

Your password is: A-very-long-password-generated-by-rclone
Use this password? Please note that an obscured version of this
password (and not the password itself) will be stored under your
configuration file, so keep this generated password in a safe place.
y) Yes (default)
n) No
y/n> y

Rclone打印配置并询问是否一切正常 Enter 要检查它:

Remote config
--------------------
[encrypted]
type = crypt
remote = onedrive:Backups
filename_encryption = standard
directory_name_encryption = true
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>

如何加密Rclone配置文件

Rclone加密密码存储在配置文件中,略微隐藏。为了保护这一点,我们建议加密Rclone配置文件。
通过Rclone配置非常容易做到这一点。类型:

rclone config

它显示了当前配置的遥控器,以及一些选项。

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> s

类型 sEnter 设置配置密码的键。
将出现以下屏幕:

Your configuration is not encrypted.
If you add a password, you will protect your login information to cloud services.
a) Add Password
q) Quit to main menu
a/q> a

类型 a,提示您输入Rclone配置密码。

Enter NEW configuration password:
password:
Confirm NEW configuration password:
password:
Password set
Your configuration is encrypted.
c) Change Password
u) Unencrypt configuration
q) Quit to main menu
c/u/q> q

两次输入新的Rclone配置密码后,键入: q 停下来。

Rclone云存储加密如何工作

首先,我将解释这是如何工作的,然后,向您展示如何使用Rclone加密云存储文件。
假设您有一个名为 backup.tar.gz 在我的计算机上,将加密的文件上传到名为OneDrive Backup的文件夹中。为此,Rclone crypt remote( encrypted:)加密设置为的远程路径 onedrive:Backups..
如果您复制此 backup.tar.gz 归档到 encrypted:将被加密并上传到OneDrive备份文件夹。

rclone copy backup.tar.gz encrypted:

然后文件 onedrive:Backups 远程文件夹,此文件将显示为已加密。

rclone ls onedrive:Backups
    57480 aj7e9bv453dhpfdgskvieqmrtc

如果您在列出文件 encrypted: 远程,我可以解密并查看此文件:

rclone ls encrypted:
    57432 backup.tar.gz

如果需要此文件,可以从以下位置将其复制到计算机中: encrypted: 远程(文件解密并复制到我的计算机,如下所示 ~/ 这是您的主文件夹):

rclone copy encrypted:backup.tar.gz ~/

因此,只要您要访问此文件, encrypted: 通过Rclone进行远程控制。在OneDrive网站上,此文件已加密,只有在使用Rclone crypt remote(即Rclone的跨平台Qt GUI,Rclone浏览器,加密的远程文件和加密的文件)解密后才能使用。它支持Rclone配置文件,因此您可以继续使用加密文件。