Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

tpmadm(8)

Name

tpmadm - administer Trusted Platform Module

Synopsis

tpmadm status
tpmadm init
tpmadm clear [lock | owner]
tpmadm auth
tpmadm keyinfo [uuid]
tpmadm deletekey uuid
tpmadm migrate export UUID [MigDataFile MigKeyfile]
tpmadm migrate import [MigDataFile MigKeyfile [ParentUUID]
     [NewKeyUUID]]
tpmadm failover
tpmadm pcrextend pcr [filename]
tpmadm pcrreset pcr

Description

A Trusted Platform Module (TPM) is a hardware component that provides for protected key storage and reliable measurements of software used to boot the operating system. The tpmadm utility is used to initialize and administer the TPM so that it can be used by the operating system and other programs.

The TPM subsystem can store and manage an unlimited number of keys for use by the operating system and by users. Each key is identified by a Universally Unique Identifier, or UUID.

Although the TPM can hold only a limited number of keys at any given time, the supporting software automatically loads and unloads keys as needed. When a key is stored outside the TPM, it is always encrypted or “wrapped” by its parent key so that the key is never exposed in readable form outside the TPM.

Before the TPM can be used, it must be initialized by the platform owner. This process involves setting an owner password which is used to authorize privileged operations.

Although the TPM owner is similar to a traditional superuser, there are two important differences. First, process privilege is irrelevant for access to TPM functions. All privileged operations require knowledge of the owner password, regardless of the privilege level of the calling process. Second, the TPM owner is not able to override access controls for data protected by TPM keys. The owner can effectively destroy data by re-initializing the TPM, but cannot access data that has been encrypted using TPM keys owned by other users.

Sub Commands

The following subcommands are used in the form:

# tpamadm <subcommand> [operand]
status

Report status information about the TPM. Output includes basic information about whether ownership of the TPM has been established, current PCR contents, and the usage of TPM resources such as communication sessions and loaded keys.

init

Initialize the TPM for use. This involves taking ownership of the TPM by setting the owner authorization password. Taking ownership of the TPM creates a new storage root key, which is the ancestor of all keys created by this TPM. Once this command is issued, the TPM must be reset using BIOS operations before it can be re-initialized.

The tpmadm init subcommand prompts you to create a TPM Owner PIN (or passphrase) twice.

Here is an example. The PIN is not displayed on the screen, but is shown in this example:

# tpmadm init
Enter TPM Owner PIN: 87654321
Confirm TPM Owner PIN: 87654321

Some tpmadm subcommands require you to re-enter this PIN, so do not forget it.

auth

Change the owner authorization password for the TPM.

clear lock

Clear the count of failed authentication attempts. After a number of failed authentication attempts, the TPM responds more slowly to subsequent attempts, in an effort to thwart attempts to find the owner password by exhaustive search. This command, which requires the correct owner password, resets the count of failed attempts.

This command must be executed before "tpmadm clear owner", if both are being cleared.

clear owner

Deactivate the TPM and return it to an unowned state. This operation, which requires the current TPM owner password, invalidates all keys and data tied to the TPM. Before the TPM can be used again, the system must be restarted, the TPM must be reactivated from the BIOS or ILOM pre-boot environment, and the TPM must be re-initialized using the tpmadm init command.

keyinfo [uuid]

Report information about keys stored in the TPM subsystem. Without additional arguments, this subcommand produces a brief listing of all keys. If the UUID of an individual key is specified, detailed information about that key is displayed.

deletekey uuid

Delete the key with the specified UUID from the TPM subsystem's persistent storage.

migrate export UUID [MigDataFile MigKeyfile]

Create the initial migration blob and key for the persistent key UUID. If necessary, the user will be prompted for a password to access the key being migrated. Additionally, the user will be prompted to create an authorization password for the migration key. This operation creates two files: a migration blob (wrapped key) and a migration key to be used in future migrations. The output files will be named tpm-migration.dat and tpm-migration.key, unless they are specified on the command line. This operation will require TPM owner authorization as well as authorization passwords for any parent keys that must be loaded in order to load the key being exported. The user will be prompted for all authorization passwords as needed.

If you are exporting the Storage Root Key (SRK), use 00000000-0000-0000-0000-00000000000b for the SRK UUID.

The tpmadm migrate export subcommand prompts for the TPM Owner PIN that was created with the tpmadm init subcommand. Additionally, it will prompt you to create a migration PIN to use with the tpmadm migrate import subcommand.

Here is an example. The PIN is not displayed on the screen, but is shown in this example:

# tpmadm migrate export 00000000-0000-0000-0000-00000000000b
Enter TPM Owner PIN: 87654321
Enter PIN for the migration key: BAKUP555
Confirm PIN for the migration key: BAKUP555
migrate import [MigDataFile MigKeyFile [ParentUUID] NewKeyUUID]

Import a key into the user's persistent key DB. The key will be made a child of the given ParentUUID. If ParentUUID is not given, the imported key will be a child of the system MRK UUID. If NewKeyUUID is not given, the system will generate a new UUID and report it to the user upon completion of the command. The user will be prompted for the migration password used in the “export” step. When the migrate import command is given with no arguments, the import operation will attempt the migration of the SYSTEM MRK UUID to the current SRK in the system key db. When importing an MRK, answer "y" to the question "Migratable Root Key file(s) already exist; overwrite [y/N]?", otherwise, the existing MRK will not be overwritten with the imported MRK. The user must have the TPM Administration rights (see prof_attr(5)) or have root privilege (euid == 0). This operation will require TPM owner authorization as well as authorization passwords for any parent keys that must be loaded in order to load the key being exported. The user will be prompted for all authorization passwords as needed.

tpmadm migrate import

This subcommand prompts for the migration PIN that was created with the tpmadm migrate export subcommand.

Here is an example. The PIN is not displayed on the screen, but is shown in this example:

# tpmadm migrate import
Enter TPM Owner PIN: BAKUP555
Enter PIN for the migration key: BAKUP555
failover

Enable TPM failover (for SPARC T7 and later platforms). This prompts for the TPM Owner PIN and a new PIN for the migration key. These will be used to back up and restore the TPM keystore in case the TPM chip fails over to a new TPM chip on another SPARC SP/SPP board.

pcrextend pcr [filename]

Create an SHA-1 hash of the contents of filename and perform a PCR Extend operation on the indicated PCR using the hash value as the data to be extended. If a filename is not specified, the data is read from stdin.

pcrreset pcr

Reset the indicated PCR to its initial state (all zeros).

Exit Status

After completing the requested operation, tpmadm exits with one of the following status values.

0

Successful termination.

1

Failure. The requested operation could not be completed.

2

Usage error. The tpmadm command was invoked with invalid arguments.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

See Also

prof_attr(5), attributes(7)

See also the tcsd(8) man page, available in the pkg:/library/security/trousers package.

TCG Software Stack (TSS) Specifications: https://www.trustedcomputinggroup.org/specs/TSS (as of the date of publication)

Notes

tpmadm communicates with the TPM device through the tcsd service. tcsd must be running before using the tpmadm command. If tcsd is not running, tpmadm will generate the following error:

Connect context: Communication failure (0x3011)

See tcsd(8) for more details.