SSH-TPM-AGENT(1) ssh-tpm-agent manual SSH-TPM-AGENT(1) (NAME) ssh-tpm-agent - ssh-agent TPM 2.0 (SYNOPSIS) ssh-tpm-agent [OPTIONS] ssh-tpm-agent --print-socket ssh-tpm-agent --install-user-units (DESCRIPTION) ssh-tpm-agent (TPM) (wrapped) . (OPTIONS) -l PATH UNIX . $XDG_RUNTIME_DIR/ssh-tpm-agent.sock . -A PATH (fallback) ssh-agent . --print-socket STDIN . --key-dir PATH (sealed) TPM . ~/.ssh . --no-load TPM ~/.ssh . -o, --owner-password . --no-cache (cache) . --hierarchy HIERARCHY (hierarchy keys) . Hierarchy Keys . : o owner, o o endorsement, e o null, n o platform, p -d (debug). --install-user-units systemd sshd ssh-tpm-agent (hostkey agent) . --swtpm TPM swtpm . . SSH_TPM_AGENT_SWTPM . ssh-tpm-agent (drop-in) ssh-agent . $ ssh-tpm-keygen # ~/.ssh/id_ecdsa.pub $ ssh-tpm-agent & $ export SSH_AUTH_SOCK=$(ssh-tpm-agent --print-socket) $ ssh git@github.com keygen ssh-tpm-keygen(1) . (Agent fallback) ssh-tpm-agent (fallback) ssh-agent . -A . ssh-tpm-agent (fan-out). . # ssh-agent $ eval $(ssh-agent) # RSA $ ssh-keygen -t rsa -b 4096 -f id_rsa -C ssh-agent ... The key fingerprint is: SHA256:zLSeyU/6NKHGEvyZLA866S1jGqwdwdAxRFff8Z2N1i0 ssh-agent $ ssh-add id_rsa Identity added: id_rsa (ssh-agent) # $ ssh-add -L ssh-rsa AAAAB3NzaC1yc[...]8TWynQ== ssh-agent # TPM $ ssh-tpm-keygen -C ssh-tpm-agent Generating a sealed public/private ecdsa key pair. Enter file in which to save the key (/home/user/.ssh/id_ecdsa): Enter passphrase (empty for no passphrase): Confirm passphrase: Your identification has been saved in /home/user/.ssh/id_ecdsa.tpm Your public key has been saved in /home/user/.ssh/id_ecdsa.pub The key fingerprint is: SHA256:PoQyuzOpEBLqT+xtP0dnvyBVL6UQTiQeCWN/EXIxPOo The key's randomart image is the color of television, tuned to a dead channel. # ssh-tpm-agent $ ssh-tpm-agent -A "${SSH_AUTH_SOCK}" & $ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)" # ssh-agent ssh-tpm-agent $ ssh-add -L ssh-rsa AAAAB3NzaC1yc[...]8TWynQ== ssh-agent ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNo[...]q4whro= ssh-tpm-agent ssh-tpm-agent (host keys) ssh . ssh-tpm-hostkeys systemd . ssh-tpm-agent /var/tmp/ssh-tpm-agent.sock . $ sudo ssh-tpm-keygen -A 2023/09/03 17:03:08 INFO Generating new ECDSA host key 2023/09/03 17:03:08 INFO Wrote /etc/ssh/ssh_tpm_host_ecdsa_key.tpm 2023/09/03 17:03:08 INFO Generating new RSA host key 2023/09/03 17:03:15 INFO Wrote /etc/ssh/ssh_tpm_host_rsa_key.tpm $ sudo ssh-tpm-hostkeys --install-system-units Installed /usr/lib/systemd/system/ssh-tpm-agent.service Installed /usr/lib/systemd/system/ssh-tpm-agent.socket Installed /usr/lib/systemd/system/ssh-tpm-genkeys.service Enable with: systemctl enable --now ssh-tpm-agent.socket $ sudo ssh-tpm-hostkeys --install-sshd-config Installed /etc/ssh/sshd_config.d/10-ssh-tpm-agent.conf Restart sshd: systemd restart sshd $ systemctl enable --now ssh-tpm-agent.socket $ systemd restart sshd $ sudo ssh-tpm-hostkeys ecdsa-sha2-nistp256 AAAAE2V[...]YNwqWY0= root@localhost ssh-rsa AAAAB3NzaC1ycA[...]N1Jg3fLQKSe7f root@localhost $ ssh-keyscan -t ecdsa localhost # localhost:22 SSH-2.0-OpenSSH_9.4 localhost ecdsa-sha2-nistp256 AAAAE2V[...]YNwqWY0= (drop-in) sshd /etc/ssh/sshd_config.d . HostKeyAgent /var/tmp/ssh-tpm-agent.sock HostKey /etc/ssh/ssh_tpm_host_ecdsa_key.pub HostKey /etc/ssh/ssh_tpm_host_rsa_key.pub TPM (static keys) . (session) . ssh-tpm-keygen TPM . ssh-tpm-agent . $ ssh-tpm-agent --hierarchy owner & $ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)" $ ssh-add -l 2048 SHA256:yt7A20tcRnzgaD2ATgAXSNWy9sP6wznysp3SkoK3Gj8 Owner hierarchy key (RSA) 256 SHA256:PmEsMeh/DwFP04iUaWLNeX4maMR6r1vfqw1BbbdFjIg Owner hierarchy key (ECDSA) sshd (public) -A --hierarchy . $ ssh-tpm-keygen -A --hierarchy owner 2025/03/10 21:57:08 INFO Generating new hierarcy host key algorithm=RSA hierarchy=owner 2025/03/10 21:57:10 INFO Wrote public key filename=/etc/ssh/ssh_tpm_host_rsa_key.pub 2025/03/10 21:57:10 INFO Generating new hierarcy host key algorithm=ECDSA hierarchy=owner 2025/03/10 21:57:10 INFO Wrote public key filename=/etc/ssh/ssh_tpm_host_ecdsa_key.pub HostKey ssh_config . . endorsement . . owner . tpm2_clear(1) (rotate) . null . (power cycle) . : . ssh-tpm-agent TPM . ssh-tpm-keygen TPM . (ENVIRONMENT) SSH_TPM_AUTH_SOCK (unix-domain socket) (agent) . /var/tmp/ssh-tpm-agent.sock . SSH_ASKPASS ssh-tpm-agent . SSH_ASKPASS . ssh(1) ENVIRONMENT . SSH_ASKPASS_REQUIRE askpass . : o never ssh askpass . o prefer askpass . o force (passphrase) askpass . ssh(1) ENVIRONMENT . SSH_TPM_AGENT_SWTPM ssh-tpm-agent (backend) swtpm . (true) . SSH_TPM_LANDLOCK ssh-tpm-agent (sandbox) landlock . . landlock(7) . ~/ssh/id_rsa.tpm, ~/ssh/id_ecdsa.tpm ssh ssh-tpm-agent . TPM 2.0 TSS TPM (wrap) . TPM . ~/ssh/id_rsa.pub, ~/ssh/id_ecdsa.pub ssh . ssh-keygen(1) . /run/user/$UID/ssh-tpm-agent.sock UNIX ssh-tpm-agent. . /var/tmp/ssh-tpm-agent.sock UNIX ssh-tpm-agent. (host keys) . (SEE ALSO) ssh-agent(1), ssh(1), ssh-tpm-keygen(1), ssh-keygen(1) (NOTES, STANDARDS AND OTHER) ASN.1 TPM 2.0 ssh TPM: ssh-tpm-agent ssh-tpm-agent v0.9.0 2026-08-10 SSH-TPM-AGENT(1)