Como corrigir no Ubuntu open /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1: No such file or directory
Problema
No Ubuntu 26.04 ou posterior, quando você quer se conectar a um host SSH usando uma chave SSH baseada em TPM, você vê o seguinte erro:
tpm2_pkcs11_error.txt
lib_contains_symbol: open /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1: No such file or directory
provider /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1 is not a PKCS11 library
Received disconnect from 100.64.0.132 port 22:2: Too many authentication failures
Disconnected from 10.1.2.3 port 22Solução
Entre o Ubuntu 24.04 e o 26.04, o pacote libtpm2-pkcs11-1 foi atualizado e, portanto, o arquivo de biblioteca foi movido de
old_pkcs11_path.txt
/usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1para
new_pkcs11_path.txt
/usr/lib/x86_64-linux-gnu/pkcs11/libtpm2_pkcs11.soPortanto, você precisa editar sua configuração SSH (tipicamente em ~/.ssh/config ou em /etc/ssh/ssh_config) e alterar o caminho da biblioteca provedora PKCS11 para o novo caminho.
Por exemplo, altere isto:
ssh_config_example_old
Host myserver
HostName myserver.mydomain.com
PasswordAuthentication no
PKCS11Provider /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1para
ssh_config_example
Host myserver
HostName myserver.mydomain.com
PasswordAuthentication no
PKCS11Provider /usr/lib/x86_64-linux-gnu/pkcs11/libtpm2_pkcs11.soCheck out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow