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
--portablewith 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 packageage).- Encrypted swap and hibernation storage (guide).
- The vault passphrase, the approval passphrase and a place to keep the recovery key offline.
Steps
-
Seal an identity to the TPM. Use
--serverfor a server, or--portablefor a laptop whose disk is encrypted with a pre-boot secret. Typeyeswhen it asks:sudo iron-vault-provision-host-unlock --serverIt prints a recipient key,
age1…, and writes/etc/iron-vault-host/host-unlock.cred. Note the key. -
Start the handoff unit:
sudo systemctl start iron-vault-host-unlock.service -
Enrol the identity. For a new vault,
initdoes it, and shows the recovery key once: store it offline.sudo iron-vault init --host-unlock sudo iron-vault unlockFor 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" -
Prove the recovery key still opens the vault:
sudo iron-vault recovery check -
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 withsudo iron-vault unlock, then follow After the update. If the handoff unit’s journal (journalctl -b -u iron-vault-host-unlock.service) saysdictionary attack lockout modeinstead, 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. Checksystemctl status iron-vault-host-unlock.serviceand that/etc/iron-vault-host/host-unlock.credexists.host unlock: refused. The service would not use the handoff. Thevault.host-unlockrecord in the audit log gives the reason. Runsudo iron-vault unlock, fix the cause, and restart the service.host unlock: owner_locked. An earlierlockis still in force. A passphraseunlockclears 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
- TPM unlock in the install guide, including retiring it
- Files and locations
- Design and §14 of the specification.