commit b49e3f9fc9b3910fa401b632fb567cbd652cab0b from: Alejandro Bernal Estrada date: Thu May 21 21:25:29 2026 UTC fix: pre-cachear PIN en yubico y usar pinentry-curses commit - 4af61d4412a45612c07e0915bcae9f78a32e9c65 commit + b49e3f9fc9b3910fa401b632fb567cbd652cab0b blob - 295ce4da959fdad1d56c9f880bee60a753ca3688 blob + 10bb8f1cacb55ffd4659618e9c9bd59b3e3ddd2a --- system/home.scm +++ system/home.scm @@ -31,8 +31,8 @@ export DISPLAY=${DISPLAY:-:0} export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0} gpgconf --launch gpg-agent -# Resetea gpg-agent y refresca el contexto de pinentry. -# Correr si GPG o SSH falla tras desconectar/reconectar el YubiKey. +# Resetea gpg-agent y pre-cachea el PIN para que SSH funcione sin prompt. +# La conexión SSH expira si el PIN se introduce durante el handshake. yubico() { echo \"Reiniciando gpg-agent...\" gpgconf --kill gpg-agent @@ -41,12 +41,13 @@ yubico() { export DISPLAY=${DISPLAY:-:0} export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0} gpgconf --launch gpg-agent - # Notifica al nuevo agente el TTY/display para que pinentry funcione en SSH gpg-connect-agent updatestartuptty /bye &>/dev/null - if ssh-add -L &>/dev/null; then - echo \"OK — YubiKey lista\" + echo \"Introduce el PIN del YubiKey para cachear la sesión...\" + if echo \"\" | gpg --clearsign -u 91CA581F7B7801E88673D228DBD5F61D8A0A14D7 \ + > /dev/null 2>&1; then + echo \"OK — YubiKey lista (PIN cacheado, SSH disponible)\" else - echo \"Error: no se detecta la clave. ¿Está conectada la YubiKey?\" + echo \"Error: fallo al cachear PIN. ¿Está conectada la YubiKey?\" fi } ")) @@ -65,9 +66,9 @@ enable-ssh-support default-cache-ttl 600 max-cache-ttl 7200 -# pinentry-qt: diálogo gráfico para KDE Plasma -# gpg-agent lo localiza via PATH del perfil de usuario -pinentry-program pinentry-qt +# pinentry-curses: funciona en cualquier terminal sin depender de display +# Necesario porque SSH auth expira si se espera a que aparezca una ventana Qt +pinentry-program pinentry-curses ")) ;; ══════════════════════════════════════════════════════════════════