Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Remote passphrase for luks drive

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
dpa
Posts: 3
Joined: 2022-06-15 02:59

Remote passphrase for luks drive

#1 Post by dpa »

Hello,

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"
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.

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
Find below two screenshots showing what I expect to get into the passphrase field and what I am actually getting.
Plain passphrase.png
Plain passphrase.png (85.94 KiB) Viewed 650 times
Plain passphrase.png
Plain passphrase.png (85.94 KiB) Viewed 650 times
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.
Attachments
Script to retrieve passphrase.png
Script to retrieve passphrase.png (94.69 KiB) Viewed 650 times

dpa
Posts: 3
Joined: 2022-06-15 02:59

Re: Remote passphrase for luks drive

#2 Post by dpa »

Hello,

Anyone could assist me somehow on this issue?

Thanks.

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Remote passphrase for luks drive

#3 Post by CwF »

What your using as as the passphrase file I believe should be an 'answer file' and not the script. If the script returns correctly, then make it set a variable and separately read in. The script needs run first, stdout > /etc/luks-key/luks-18TB.
Just a guess.

dpa
Posts: 3
Joined: 2022-06-15 02:59

Re: Remote passphrase for luks drive

#4 Post by dpa »

CwF,

Thanks for your reply. I will explore your suggestions and let you know if I succeed.

Post Reply