swtpm_setup(8) swtpm_setup(8) (NAME) swtpm_setup - (TPM) (SYNOPSIS) swtpm_setup [OPTIONS] (DESCRIPTION) swtpm_setup TPM libtpms . (OPTIONS) : --runas (userid) swtpm_setup . root . --config : swtpm_setup.conf. . : XDG_CONFIG_HOME ${XDG_CONFIG_HOME}/swtpm_setup.conf HOME ${HOME}/.config/swtpm_setup.conf . /etc/swtpm_setup.conf . --tpm-state or --tpmstate TPM . dir:// file:// . --tpm TPM swtpm PATH . --tpm2 TPM 2 TPM 1.2 . --createek (EK). --allow-signing EK . --tpm2 . EK . EK TPM 2 EK ( EK Template) NV EK ( NV 0x01c00004 RSA 2048 EK). EK (modulus) EK . TCG <> <> << .>> EK . --decryption EK (key encipherment) . --allow-signing . --tpm2 . --ecc (ECC) RSA . --take-ownership --createek . TPM 1.2 . --ownerpass ooo . TPM 1.2 . --owner-well-known ( ) . TPM 1.2 . --srkpass SRK sss . TPM 1.2 . --srk-well-known ( ) SRK. TPM 1.2 . --create-ek-cert EK --createek . --create-platform-cert --create-ek-cert . --lock-nvram NVRAM NVRAM . --display TPM . --logfile . stdout stderr . --keyfile (ASCII hex) 0x . TPM TPM . --keyfile-fd --keyfile (file descriptor) . --pwdfile TPM TPM . --pwdfile-fd --pwdfile . --ciper (cipher) aes-cbc aes-128-cbc AES aes-256-cbc AES . swtpm . --overwrite TPM. . . --not-overwrite TPM . TPM . --vmid (VM ID) ( ) . . --pcr-banks PCR . - PCR . swtpm_setup.conf active_pcr_banks . PCR . PCR --help . --swtpm_ioctl swtpm_ioctl . swtpm_ioctl PATH . --tcsd-system-ps-file ( 0.4). --rsa-keysize (since v0.4) TPM 2 RSA EK 2048 3072. TPM 2 --print-capabilities . TPM 1.2 TPM 2 . max . --reconfigure (since v0.7) PCR TPM 2 --pcr-banks . --profile (since v0.10) TPM 2 . : {"Name": "null"} {"Name": "default-v1"} { "Name": "custom", "Algorithms":"rsa,rsa-min-size=1024,tdes-min-size=128,hmac,aes,\ aes-min-size=128,mgf1,keyedhash,xor,sha256,sha384,\ sha512,null,rsassa,rsaes,rsapss,oaep,ecdsa,ecdh,ecdaa,\ sm2,ecschnorr,ecmqv,kdf1-sp800-56a,kdf2,kdf1-sp800-108,\ ecc,ecc-min-size=192,ecc-nist,ecc-bn,symcipher,camellia,\ camellia-min-size=128,cmac,ctr,ofb,cbc,cfb,ecb" } JSON name libtpms . custom custom: Algorithms Commands Attributes . JSON . swtpm . --profile-name TPM 2 : o swtpm_setup.conf local_profiles_dir local: . o /usr/share/swtpm/profiles distro: . o libtpms builtin: . .json . --print-profiles --tpm2 . --profile-file (since v0.10) TPM 2 . --profile-file-fd (since v0.10) TPM 2 . --profile-remove-disabled check|fips-host (since v0.10) swtpm OpenSSL FIPS . check fips-host . custom --profile '{"Name":"custom:test"}'. remove-disable --profile swtpm . swtpm . --print-profiles (since v0.10) . .json . JSON --profile-name .json . myprofile.json Name myprofile . Name JSON custom:myprofile . --print-capabilities (since v0.2) 0.1 swtpm_setup . : { "type": "swtpm_setup", "features": [ "tpm-1.2", "tpm-2.0", "cmdarg-keyfile-fd", "cmdarg-pwdfile-fd", "tpm12-not-need-root", "cmdarg-write-ek-cert-files", "cmdarg-create-config-files", "cmdarg-reconfigure-pcr-banks", "tpm2-rsa-keysize-2048", "tpm2-rsa-keysize-3072", "cmdarg-profile", "cmdarg-profile-remove-disabled" ], "version": "0.7.0" } version 0.7 . (feature verbs) : cmdarg-key-fd (since v0.2) --keyfile-fd . cmdarg-pwd-fd (since v0.2) --pwdfile-fd . cmdarg-write-ek-cert-files (since v0.7) --write-ek-cert-files . cmdarg-create-config-files (since v0.7) --create-config-files . cmdarg-reconfigure-pcr-banks (since v0.7) --reconfigure PCR . tpm2-rsa-keysize-2048, ... (since v0.4) RSA EK TPM 2 . tpm2-rsa-keysize RSA . tpm12-not-need-root (since v0.4) TPM 1.2 . root tss . tpm-1.2 (since v0.7) TPM 1.2 (libtpms TPM 1.2 ). tpm-2.0 (since v0.7) TPM 2 (libtpms TPM 2 ). cmdarg-profile (since v0.10) --profile --profile-file --profile-file-fd . cmdarg-profile-remove-disabled (since v0.10) --profile-remove-disabled . --write-ek-cert-files (since v0.7) (EK) . EK DER NVRAM TPM 1.2 TPM 2 . EK ek-.crt . : ek-rsa2048.crt ek-rsa3072.crt ek-secp384r1.crt. TPM 2 EK . EK . --create-config-files [[overwrite][,root][,skip-if-exist]] (since v0.7) swtpm_setup swtpm- localca $XDG_CONFIG_HOME $HOME/.config . . : overwrite . root root. (shadow ) /etc/swtpm-localca.conf . skip-if-exist . . : . tss . swtpm-localca.conf ( ) /etc/swtpm-localca.conf . --help, -h (EXAMPLE USAGE) TPM : #> sudo swtpm_setup --tpmstate /tmp/mytpm1/ \ --create-ek-cert --create-platform-cert --lock-nvram : 0.4 TPM 1.2 root . TPM swtpm_localca . XDG_CONFIG_HOME ( bash): export XDG_CONFIG_HOME=~/.config : XDG_CONFIG_HOME XDG (XDG Base Directory Specification) . : ~/.config/swtpm_setup.conf: # Program invoked for creating certificates create_certs_tool= /usr/share/swtpm/swtpm-localca create_certs_tool_config = ${XDG_CONFIG_HOME}/swtpm-localca.conf create_certs_tool_options = ${XDG_CONFIG_HOME}/swtpm-localca.options ~/.config/swtpm-localca.conf: statedir = ${XDG_CONFIG_HOME}/var/lib/swtpm-localca signingkey = ${XDG_CONFIG_HOME}/var/lib/swtpm-localca/signkey.pem issuercert = ${XDG_CONFIG_HOME}/var/lib/swtpm-localca/issuercert.pem certserial = ${XDG_CONFIG_HOME}/var/lib/swtpm-localca/certserial ~/.config/swtpm-localca.options: --platform-manufacturer Fedora --platform-version 2.12 --platform-model QEMU : swtpm-create-user-config-files ( ) : #> /usr/share/swtpm/swtpm-create-user-config-files Writing /home/stefanb/.config/swtpm_setup.conf. Writing /home/stefanb/.config/swtpm-localca.conf. Writing /home/stefanb/.config/swtpm-localca.options. TPM 2 EK . TPM 2 ${XDG_CONFIG_HOME}/mytpm1 . #> mkdir -p ${XDG_CONFIG_HOME}/mytpm1 #> swtpm_setup --tpm2 --tpmstate ${XDG_CONFIG_HOME}/mytpm1 \ --create-ek-cert --create-platform-cert --lock-nvram (SEE ALSO) swtpm_setup.conf (REPORTING BUGS) Stefan Berger swtpm 2026-03-26 swtpm_setup(8)