Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Unlock at boot with a TPM

Not run: this recipe needs root and a TPM 2.0 on Ubuntu 26.04 (or 24.04), and none was available when it was checked, so no output is shown. Every command comes from the TPM unlock section of the Linux install guide.

Make a protected Linux install reach Ready after a reboot with no iron-vault unlock, from a key that systemd-creds seals to the machine’s TPM. The vault passphrase and recovery key still work.

TPM unlock has had no release check on a real machine yet, so don’t rely on it to protect real secrets.

Before you start:

  • There is no TPM PIN. Anyone who can boot the machine into a trusted image can start the vault. On a laptop, use --portable with a disk encrypted under a pre-boot secret.
  • A Secure Boot update ends it. The service starts Locked; unlock with the passphrase, then provision again (see before a Secure Boot key or firmware update).
  • Ubuntu 26.04 LTS; also runs on 24.04. On 24.04 the provisioning helper notes that no release check runs there. Elsewhere the helper stops and the service starts Locked.

Prerequisites

  • Ubuntu 26.04 LTS (or 24.04) with Secure Boot on and a TPM 2.0, and the package installed as in the install guide.
  • age-keygen (Ubuntu package age).
  • Encrypted swap and hibernation storage (guide).
  • The vault passphrase, the approval passphrase and a place to keep the recovery key offline.

Steps

  1. Seal an identity to the TPM. Use --server for a server, or --portable for a laptop whose disk is encrypted with a pre-boot secret. Type yes when it asks:

    sudo iron-vault-provision-host-unlock --server
    

    It prints a recipient key, age1…, and writes /etc/iron-vault-host/host-unlock.cred. Note the key.

  2. Start the handoff unit:

    sudo systemctl start iron-vault-host-unlock.service
    
  3. Enrol the identity. For a new vault, init does it, and shows the recovery key once: store it offline.

    sudo iron-vault init --host-unlock
    sudo iron-vault unlock
    

    For an existing vault, enrol the key from step 1 instead, with the vault passphrase:

    sudo iron-vault recipient add --host-unlock age1… --label "host unlock"
    
  4. Prove the recovery key still opens the vault:

    sudo iron-vault recovery check
    
  5. Reboot, and look at the service without typing anything:

    sudo reboot
    # after the machine is back
    sudo iron-vault status
    

The recipe ends when status shows the service Ready and the host unlock outcome unlocked, with no unlock since the reboot:

service: ready
…
host unlock: unlocked

What can go wrong

  • host unlock: unseal_failed. The TPM would not unseal the key, as after a Secure Boot or firmware update. Type the passphrase with sudo iron-vault unlock, then follow After the update. If the handoff unit’s journal (journalctl -b -u iron-vault-host-unlock.service) says dictionary attack lockout mode instead, the TPM is in lockout: don’t provision again, see A TPM in lockout.
  • host unlock: absent. No blob, or the handoff unit did not run. Check systemctl status iron-vault-host-unlock.service and that /etc/iron-vault-host/host-unlock.cred exists.
  • host unlock: refused. The service would not use the handoff. The vault.host-unlock record in the audit log gives the reason. Run sudo iron-vault unlock, fix the cause, and restart the service.
  • host unlock: owner_locked. An earlier lock is still in force. A passphrase unlock clears it (lock, unlock and restart).
  • The helper fails with an error from systemd-creds. Another operating system may have set the TPM’s owner password.

Reference