I want to provide the password for my crypt remote on the command line, and not have it stored anywhere on disk. I created the crypt remote using rclone config as per the documentation. Then I tried to mount the remote on a local directory, but rclone doesn't ask me for the password and fails.
I was able to work around the problem using the --crypt-password parameter and created a script to do it, but I thought I'd see if I was doing something wrong.
My workaround:
# Get the password
echo 'Enter the rclone password:'
read -s RCLONE_PWD
OBSCURED=$(rclone obscure $RCLONE_PWD)
# Mount the drive
rclone -vv mount my_crypt_remote: /mnt/mydir/ --crypt-password $OBSCURED --daemon
# Clean up
unset OBSCURED
unset RCLONE_PWD
Run the command 'rclone version' and share the full output of the command.
rclone v1.64.2
os/version: arch "rolling" (64 bit)
os/kernel: 6.5.9-arch2-1 (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.21.3
go/linking: dynamic
go/tags: none
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 -vv --ask-password=true mount my_crypt_remote: /mnt/mydir/
The rclone config contents with secrets removed.
[my_crypt_remote]
type = crypt
remote = my_gdrive_remote:my_encrypted_dir
A log from the command with the -vv flag
[myuser@mypc ~]$ rclone -vv --ask-password=true mount my_crypt_remote: /mnt/mydir/
2024/04/02 14:13:08 DEBUG : rclone: Version "v1.64.2" starting with parameters ["rclone" "-vv" "--ask-password=true" "mount" "my_crypt_remote:" "/mnt/mydir/"]
2024/04/02 14:13:08 DEBUG : Creating backend with remote "my_crypt_remote:"
2024/04/02 14:13:08 DEBUG : Using config file from "/home/myhome/.config/rclone/rclone.conf"
2024/04/02 14:13:08 Failed to create file system for "my_crypt_remote:": password not set in config file
Thanks, I misread the documentation before but I now see that it does say that.
I think the crypt documentation about passwords is a bit confusing and I think my method of providing the password might help some people, so I will put together a pull request for some documentation changes.