• We did not send an email asking for donations - please read this post.

Place a passphrase file into a remote server


New Member
Jun 18, 2022
Reaction score

I am trying to unlock a luks encrypted drive using a passphrase located into a remote server. In order to test if the retrieval process works properly, I got a code from https://withblue.ink/2020/01/19/auto-mounting-encrypted-drives-with-a-remote-key-on-linux.html and executed the following command into terminal:

I adjusted the above command with my own azure address and it worked well and I got the passphrase into the terminal screen (even dropping a part of the code suggested into the withblue website; "| base64 -d").

However, when I place the whole script code (showed below) into the file (/etc/luks-key/luks-18TB) to retrieve the passphrase, the passphrase field into disks application reads the script code and not the passphrase retrieved by the code.

set -e
# Request the file from Azure Blob Storage using the URL with the SAS token, then pipe it through `base64 -d` to decode it from base64
curl -s "https://ln5bxfzbl0tlf5z.blob.core.w...=gkaN2OSzN2zj1WSAPiLJMgtkcXLi2Y8EOVdBUmZQh88=" | base64 -d

Find below two screenshots showing what I expect to get into the passphrase field and what I am actually getting.

What am I missing? How should I proceed to have the script retrieving my passphrase from a remote server and unlocking my local drive?

Thanks a lot for the support.

Plain passphrase.png

Script to retrieve passphrase.png

$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online