Rclone mount with configuration password?

sorry, i do not understand your question.

you should try it yourself, see what happens and if need be ask your question after testing.

there is an ancient jewish proverb that

a good question is half the answer

Sorry :slight_smile: What i mean is:

  • when you execute a .bat with "set RCLONE_CONFIG_PASS", the .bat will open cmd and run the command, then exit cmd yes(?)
  • so the cmd with the command is instantly closed, so how does the system remember the config pass?

hi all

i new in this forum and i just start to "play" with Rclone
my need is to mount swift storage and i got into the same issue of storing my password

i didnt understand what is the final solution for this
so if someone can put a short explanation and "how to " will be also great
of how i solve this problem of not putting my pass in txt file
and that rclone mount can still work using encrypted files

  1. the batch file runs each command in order and exits after the last command has finished. so first the batch script would execute the set RCLONE_CONFIG_PASS and then run rclone.exe. the system only remembers the config password inside the batch file.
  2. i suggest that the extension of the batch file should be .cmd, not .bat
  3. try it for yourself, create a simple batch file like this and run it

set RCLONE_CONFIG_PASS=put.your.password.here
rclone.exe config dump
pause

i will help if i figure this out but im apparently to stupid :stuck_out_tongue:

Well i most be dumb cause i cant get the environment variable to work.
I didnt do the .bat but i tried manually and it seems that "SET RCLONE_CONFIG_PASS=XXXX" indeed sets that variable, as i can see with ECHO %RCLONE_CONFIG_PASS%.
But even though i after that, in the same cmd-window then try to "rclone mount remote:path windowspath" it doesnt mount.

Do i need to do steps before "SET RCLONE_CONFIG_PASS" ? I tried making a user environment variable in windows but im not sure what to type, i used "RCLONE_CONFIG_PASS" as name and "RCLONE_CONFIG_PASS" and Value (cause i dont know what else to do).

And the SET-command changes the value temporarily anyway right?

The only way i got it to mount is using nssm and making a process with the mountcommand, and that only works without as password.

edit: ok so my problem might be that "rclone.exe mount" command doesnt work regardless, it says rclone service started but it does nothing, even without config pass, hmmmmmmmm?

you are complicating the situtation.

  1. do not use the command prompt, use batch files.
  2. use my suggested .cmd file as i gave it to you and make sure it works.
  3. after that is working, work on the mount command.

yeah maybe i am, the batchfile works with
SET RCLONE_CONFIG_PASS
rclone.exe whatever command
PAUSE

But when i try to mount it just says: The service rclone has been started.
log-level DEBUG says no errors either, but it doesnt mount.. (even without config password set)

@ncw is correct, the way to protect the rclone password is with multiple layers of obfuscation.
i tend to run paranoid and here is my solution.

i script rclone with python.
i have 300+ lines of code for all my backup needs including fastcopy for copying files, 7zip for compression and rclone for cloud.
this issue of password protection applies to both 7zip and rclone.
tho i use this technique for many other use cases including net share

for rclone, i encrypt two things, the rclone password and the script that runs rclone:

  1. encrypt the rclone password and save it somewhere. i use a .ini file.
    [rclone]
    p=75D22D57

  2. i have .cmd file that runs rclone for example, let's call it doit.cmd

rclone.exe config dump
  1. i encrypt doit.cmd and save it as doit-encrypted.cmd

now both the rclone password is encrypted and the batch file is encrypted

using python i do that following

  1. decrypt rclone password
  2. decrypt doit-encrypted.cmd and copy it to a random temp file, C:\Users\user\appdata\local\temp\doit-3652171340.cmd
  3. create a custom set of environment variables containing RCLONE_CONFIG_PASS
  4. execute doit-3652171340.cmd using the custom set environment of variables.
  5. doit-3652171340.cmd runs rclone.
  6. delete the temp file doit-3652171340.cmd

RCLONE_CONFIG_PASS is passed to rclone as an environment variable instead of set RCLONE_CONFIG_PASS=password, there is no way to see the password inside the temp batch file.

doit-encrypted.cmd cannot be modified to obtain the rclone password; as each time the python script is executed, the file doit-encrypted.cmd is:

  1. decrypted
  2. copied to a temp file
  3. executed one time
  4. deleted after execution