Install 7-Zip

Open your terminal (Ctrl + Alt + T) and run the following command to update your system's package list and install the modern 7-Zip binary:

sudo apt update && sudo apt install 7zip -y

Encrypt and Archive a Directory

To bundle a folder, compress it, encrypt it with AES-256, and hide the filenames from anyone peaking inside your cloud storage, use this command:

7zz a -mhe=on -p output.7z /path/to/your/directory

Where:

    7zz: Calls the 7-Zip program.
    a: Stands for "Add" (creates an archive).
    -mhe=on: Turns on Header Encryption, which hides your file and folder names behind the password.
    -p: Prompts you to create and confirm your secure encryption password.
    output.7z: The name of the encrypted file you will upload to the cloud
    ./path/to/your/directory: The target folder you want to secure.

Before uploading it to the cloud and deleting your original files, you can quickly test that the archive is not corrupted and that your password works:

7zz t secure_backup.7z

Where:

    t stands for "Test". It will prompt you for your password and run a diagnostic check without extracting anything

Decrypt and Extract Your Directory

When you download the file from the cloud onto a new machine and need your files back, run this command:

7zz x secure_backup.7z

Where:

    x: Stands for "eXtract" with full paths (reconstructs your exact original directory structure).
    It will immediately ask: Enter password (will not be echoed):. Type your password blindly and press Enter.

Extract to a Specific Location

By default, Step 4 will unpack the files into whatever folder your terminal is currently looking at. If you want to force it to extract into a specific location (like your Desktop), add the -o flag without a space after it:

7zz x secure_backup.7z -o/home/username/Desktop/

©2023-2024 rculock.com