Encrypting config file through command line

What is the problem you are having with rclone?

I need to encrypt an existing configuration file without using the interactive mode. I found this pull request enable creating encrypted config through external script invocation by czosnek16 · Pull Request #3233 · rclone/rclone · GitHub which seems to be the solution, but I don't fully understand how to encrypt my config file after exporting the RCLONE_CONFIG_PASS variable.

Run the command 'rclone version' and share the full output of the command.

rclone v1.64.0
- os/version: centos 8.4.2105 (64 bit)
- os/kernel: 4.18.0-305.7.1.el8_4.x86_64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.1
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

The config file contains remotes for Google Drive, SFTP and Google Cloud Storage.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

I have only attempted to run this since I would like to encrypt the whole config file:

export RCLONE_CONFIG_PASS=abc123
rclone --config .config/rclone/rclone.conf config update

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive = XXX
root_folder_id =

type = google cloud storage
client_id = XXX
client_secret = XXX
project_number = XXX
object_acl = authenticatedRead
bucket_acl = authenticatedRead
location = us-central1
storage_class = REGIONAL
token = XXX

type = sftp
host = XXX
user = XXX
pass = XXX
md5sum_command = md5sum
sha1sum_command = sha1sum

A log from the command that you were trying to run with the -vv flag

Command update needs 1 arguments minimum: you provided 0 non flag arguments: []

Have a look at this approach:

I have tried this script myself (I think I needed some small fixes) and it works very well.

1 Like

That is really useful and seems to work well, but the solution I was looking for has been already implemented. I just can't seem to figure out how to use it. If there's no better answer, I'll mark this as the solution before the thread closes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.