LSD encrypted remote

What is the problem you are having with rclone?

I have an encrypted google drive remote. I've created the config file with the config create option.
The config file is as below:

[test]
type = drive
token = ...

An rclone lsd show the crypted files.

Everything is ok. Now, I've been reading the docs and I found out some options that apparently allows me to lsd the encrypted files.

--crypt-password string 
--crypt-remote

However, I'm not sure how the syntax would work. I'm trying the following, but I'm only being able to see the encrypted files:

rclone lsd --crypt-password MYKEY --crypt-remote test: test:

Is it even possible to do it this way (without adding a crypt section to the config file)?

What is your rclone version (output from rclone version)

rclone v1.54.0-DEV

  • os/arch: linux/amd64
  • go version: go1.16

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Fedora 33 64 bit

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

Google Drive

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

rclone lsd --crypt-password MYKEY --crypt-remote test: test:

You need the password and the salt.

https://rclone.org/crypt/#crypt-password

https://rclone.org/crypt/#crypt-password2

I don't get it. I encrypted my data only with the password. Salt is "" (default).

for a local crypt, this will list the decrypted filenames, without the need for a config file.

rclone ls ":crypt,remote='/path/to/localcrypt/',password='HUyhY3m22xkhhgPZLxDOM5cBU2uQaMdD',password2='XczRxwUV7b-HCJ5Ei9j_CDF7CKsFDLLU'":

You need to obscure the password as well as it's documented the link I shared.

felix@gemini:/opt/rclone$ rclone obscure testme
ZYVM08Ho3Y7CAHs-CRjPH5adJwCnBA
felix@gemini:/opt/rclone$ rclone ls testme: --crypt-password 'ZYVM08Ho3Y7CAHs-CRjPH5adJwCnBA'
      221 hosts

There is an example.

"testme" is the crypt remote or the regular remote?

What you pasted was the password I used.

My remote is testme:

[testme]
type = crypt
remote = testme
filename_encryption = off
directory_name_encryption = false

Interesting... Would that work for cloud remote as well?

yes, for any remote, including cloud.

rclone ls ":crypt,remote='gdrive:crypt',password='seJfS4uyxbzhXu9NhJPEp8xxx7mdKMFh',password2='3_G4cVM3wV_grbxxxwRJtZq30OpOu1l'":
1 Like

I'm trying to do this, but I'm getting error:

Failed to create file system for ":crypt,remote='test:crypt',password='MYPASS'": config name contains invalid characters - may only contain 0-9, A-Z ,a-z ,_ , - and space

command:
rclone lsd ":crypt,remote='test:crypt',password='MYPASS'":

The syntax is a little bit confusing. Would I need a config file for "test"? If not, how could I pass options to it (token, team_drive..., type...). I couldn't find anything in the docs.

make sure to use the latest version of rclone, v1.55.0

not sure what you are trying to do?

It would be great if I could perform operations without any config file.

sure, no need for config file, but not always pragmatical.

you posted you wanted to list the decrypted filename from a crypt, without the need for a config for that crypt.
and i showed that to you.

give me a concrete example of what you want to do.

Mount an encrypted remote and move files to an encrypted remote without a config file would be nice. I can manage tokens on my own.

do you mean rclone mount?

a crypted remote is always dependent on another remote.
so you would need two remotes, a gdrive remote and a crypt remote that uses the gdrive remote.

we gave you two ways to list files in a crypt remote, without the need to create that crypt remote in a config file.

if you want to create a remote without a config file, you can also do this

export  RCLONE_CONFIG_FTP1_TYPE=ftp
export  RCLONE_CONFIG_FTP1_HOST=127.0.0.1
export  RCLONE_CONFIG_FTP1_USER=username
export  RCLONE_CONFIG_FTP1_PASS=`$rclone obscure password`

rclone lsd FTP1:

Ok... I finally understood the syntax and successfully ran rclone lsd and rclone mount.

rclone lsd ":crypt,remote='test:',password='MYPASS'":

However, this is still dependant of a config file for the remote "test". Is there a way to pass --drive-team-drive and --drive-token to the remote "test", so I wouldn't need a config file for it as well?

yes, look at the example i posted, created a ftp remote on the fly, no config file.

1 Like

here is another way to create a remote on the fly

rclone ls :ftp: --ftp-host=127.0.0.1 --ftp-user=user --ftp-pass=`rclone obscure password`

Did you get it to work?

As mentioned in several posts here, there are several ways of defining remotes without config file: Backend path syntax, environment variables, and connection strings. For crypt you need two remotes: One crypt remote, that wraps another remote. You can create the underlying remote with environment variables (like the FTP1 example above) and then use connection string to wrap that by name ("FTP1" in the example).

It seems you can also manage entirely with a connection string: Here is a rather obscure example, just as an exercise.. It will copy

  • rclone.exe from http remote
  • into a crypt remote, wrapping an alias remote, pointing to a directory on local
C:\Temp>rclone obscure test
nzBiPodnnH92v0YXEwKyxx9SwNE
C:\Temp>rclone copy ":http,url=\""https://downloads.rclone.org\"":/v1.55.0/rclone-v1.55.0-windows-amd64.zip" ":crypt,remote=\"":alias,remote='C:\Temp':\"",password=\""nzBiPodnnH92v0YXEwKyxx9SwNE\"":"
1 Like