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-mo ... linux.html and executed the following command into terminal:
Code: Select all
curl -s "https://ln5bxfzbl0tlf5z.blob.core.windows.net/keyfiles/keyfile?se=2022-01-19T23%3A02Z&sp=r&spr=https&sv=2018-11-09&sr=b&sig=gkaN2OSzN2zj1WSAPiLJMgtkcXLi2Y8EOVdBUmZQh88%3D"
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.
Code: Select all
#!/bin/sh
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.windows.net/keyfiles/keyfile?se=2022-01-19T23%3A02Z&sp=r&spr=https&sv=2018-11-09&sr=b&sig=gkaN2OSzN2zj1WSAPiLJMgtkcXLi2Y8EOVdBUmZQh88%3D" | base64 -d
What am I missing? How should I proceed to have the script retrieving my passphrase from a remote server and unlocking my drive?
Thanks a lot for the support.