Skip to content

Is this even necessary? I found /var/lib/snapd/device/fde/recovery.key #2

@Blaimi

Description

@Blaimi

Hi there,

it took me ages to find out, how I can decrypt a TPM-Encrypted drive from a live-system or from an external system until I eventually stumbled upon this script. See also this ubuntuforums.org topic and this answer in discourse.ubuntu.com by @local-optimum where is mentioned, that “attempting to access data via an external device (in this case the live session) is an example of the attack vector this feature is designed to address”—which I absolutely disagree in this context! I used the documentation from #1 as a starting point and found out that it works like intended – thanks for this 😄.

At the end, it was an error-message which pointed me to the file /var/lib/snapd/device/fde/recovery.key. sudo snap recovery --show-keys is not working anymore on my device (I don't know why and I also care only a little why I didn't file it (yet)), but the error-message mentioned this file:

Fehler: cannot run keymgr tool: cannot run
        ["/usr/lib/snapd/snap-fde-keymgr" "add-recovery-key" "--key-file"
        "/var/lib/snapd/device/fde/recovery.key" "--devices"
        "/dev/disk/by-partuuid/4da6d9cb-7284-42b0-b3a9-efa4935faaf8"
        "--authorizations" "keyring" "--devices"
        "/dev/disk/by-partuuid/464a99d1-6401-4c36-b754-6dd113d7fcc4"
        "--authorizations"
        "file:/run/mnt/data/var/lib/snapd/device/fde/ubuntu-save.key"]: -----
        stderr: error: cannot add recovery key to LUKS device: cannot add key:
        cryptsetup failed with: Schlüsselfach 1 ist voll, bitte wählen Sie ein
        anderes. -----

(translated freely, because export LANG=C is ignored by snap: “slot 1 is already used, please use another one”)

I did a sudo diff /var/lib/snapd/device/fde/recovery.key key.out and guess what—it's empty.

I'm using now the command sudo cryptsetup luksAddKey /dev/nvme0n1p3 --key-file /var/lib/snapd/device/fde/recovery.key (and …p4 for the second encrypted partition) to add another key to be able to decrypt the drive with my own passphrase whenever I want to access it from an “external device (in this case the live session)”.

Thank you for all your work @jps-help and @lwbt which helped me to point this out. The public documentation on this feature coming from cannonical is even for an experimental feature totally bull 💩.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions