diff --git a/web/support/kb/openstack/rclone_quick_tutorial.rst b/web/support/kb/openstack/rclone_quick_tutorial.rst index 528dc5cbf7188a68f045ef992358e1ac88381007..f451b2a732cbc108282cf8f6f1d387ed0a7437bb 100644 --- a/web/support/kb/openstack/rclone_quick_tutorial.rst +++ b/web/support/kb/openstack/rclone_quick_tutorial.rst @@ -142,5 +142,80 @@ Unmount object storage ^^^^^^^^^^^^^^^^^^^^^^ To unmount, simply press ``CTRL-C`` and the mount will be interrupted. +Mounting encrypted directory +---------------------------- + +You can encrypt a directory in your remote container and decrypt it easily through ``rclone`` commands. +First, we create a new remote in the rclone configuration file. It will be a subdirectory of your working remote (i.e. ``garr-cloud`` remote and ``crypt-dir`` directory). So, everything inside ``garr-cloud:crypt-dir`` will be encrypted and anything outside won’t.:: + + $ nano .rclone.conf + +Copy and paste the following text at the end of the file:: + + [garr-cloud-crypt] + type = crypt + remote = garr-cloud:crypt_dir + filename_encryption = standard + directory_name_encryption = true + +Then set the passwords that will be saved obscured inside the config file:: + + $ rclone config password garr-cloud-crypt password <type_a_password> + $ rclone config password garr-cloud-crypt password2 <type_another_password> + +Now we need to create ``crypt_dir`` directory inside ``garr-cloud``:: + + $ rclone mkdir garr-dev:crypt_dir + +or, if you have ``garr-cloud`` still mounted on ``~/mnt-rclone``:: + + $ mkdir ~/mnt-rclone/crypt_dir + +Every file you will create inside ``garr-cloud-crypt`` container will be encrypted. +You can try it following these steps. First, we create a file to copy:: + + $ echo "Hello world" > test.txt + +Then, we copy it to the remote, in a new directory named ``test_dir``:: + + $ rclone copy test.txt garr-cloud-crypt:test_dir + +Now we can list the new created files through the mounted filesystem:: + + $ cd ~/mnt-rclone/crypt_dir/ + $ ls -R + +You will get an output similar to this:: + + .: + 0ruoo4gjnnuk01p4gok56li8ts + + ./0ruoo4gjnnuk01p4gok56li8ts: + b4tc2rcdasquuns71k9fa2uiss + +and if you cat the content of the file, you will see that it has been encrypted:: + + $ cat 0ruoo4gjnnuk01p4gok56li8ts/b4tc2rcdasquuns71k9fa2uiss + +To access and decrypt the file in a complete transparent way, you can copy it from the remote through:: + + $ rclone ls garr-cloud-crypt: + + 1048576 test_dir/test.txt + + $ rclone copy garr-cloud-crypt: new_dir + $ ls new_dir + + new_dir/: + test_dir + + new_dir/test_dir: + test.txt + + $ cat new_dir/test_dir/test.txt + Hello world + + +