Skip to content

Instantly share code, notes, and snippets.

@0xDE57
Last active August 24, 2025 09:04
Show Gist options
  • Save 0xDE57/d387badf2b94ac7586b797f984acccdd to your computer and use it in GitHub Desktop.
Save 0xDE57/d387badf2b94ac7586b797f984acccdd to your computer and use it in GitHub Desktop.
linux read tpm values quick reference

Check for TPM presence on Linux

Check /dev/

ls /dev/tpm*

If a TPM is present, you may see:

/dev/tpm0

Check /sys/

ls /sys/class/tpm/

Check the kernel logs for any TPM related entries:

dmesg | grep -i tpm

Check for TPM related information in System Management BIOS (SMBIOS) or Desktop Management Interface (DMI) tables:

dmidecode -t bios

Check loaded modules:

lsmod | grep tpm

Interacting with a TPM

Install tpm2-tools:

  • Arch-based: pacman -S tpm2-tools
  • Debian-based: apt-get install tpm2-tools
  • Red Hat-based: yum install tpm2-tools

List properties:

tpm2_getcap properties-fixed

Self test:

tpm2_selftest

Try reading Platform Configuration Registers (PCRs):

tpm2_pcrread sha1:0+sha256:0

See docs: https://tpm2-tools.readthedocs.io/en/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment