Setup
sudo dnf install tpm2-pkcs11 tpm2-pkcs11-tools -ysudo usermod -a -G tss "$(id -nu)"newgrp tssCreate Key
unset HISTFILEtpm2_ptool inittpm2_ptool inittpm2_ptool addtoken --pid=1 --label=ssh --userpin=MySecretPassword --sopin=MyRecoveryPasswordtpm2_ptool addkey --label=ssh --userpin=MySecretPassword --algorithm=ecc256Export Public Key
ssh-keygen -D /usr/lib64/pkcs11/libtpm2_pkcs11.so > ~/.ssh/my-ssh-key_using-tpm2.pubcat > ~/.ssh/config << EOFHost server PKCS11Provider /usr/lib64/pkcs11/libtpm2_pkcs11.so PasswordAuthentication noEOFPut Public Key
cat ~/.ssh/my-ssh-key_using-tpm2.pub | ssh -i ~/.ssh/my-identity-key user@server "cat >> ~/.ssh/authorized_keys"


