
Estoy intentando generar una clave gpg
$ gpg --full-gen-key
pero al final me sale un error
gpg: agent_genkey failed: No such file or directory
Key generation failed: No such file or directory
Estoy en Arch Linux.
$ gpg --version
gpg (GnuPG) 2.1.15
libgcrypt 1.7.3
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /home/me123/.gnupg
.............
El directorio /home/me123/.gnupg existe
Respuesta1
¿Eliminó el directorio /home/me123/.gnupg y luego gpg lo volvió a crear? Si es así, eso es probablemente lo que confunde al agente.
Reinicie el agente ( gpgconf --kill gpg-agent
) o, más drásticamente, reinicie su máquina e intente nuevamente.
Respuesta2
Parecería que el directorio ~/.gnupg/private-keys-v1.d (bajo algunas circunstancias) no se está creando o se creó con los permisos incorrectos.
# mkdir -p ~/.gnupg/private-keys-v1.d
# chmod 700 ~/.gnupg/private-keys-v1.d
Me lo arregló.
Respuesta3
Solo quiero agregar a este hilo antiguo, en caso de que alguien venga aquí buscando respuestas, que tuve un problema similar en macOS (Big Sur 11.2). Después de eliminar el .gnupg
directorio tuve el mismo error que OP. El ~/.gnupg/private-keys-v1.d
directorio fue recreado por GnuPG y tenía los permisos correctos. Además, matar gpg-agent
no era suficiente.
Noté un archivo extraño en el .gnupg
directorio llamado algo así como .#k0x0000000130605a20.MBP-van-##REDACTED##.52431
. Después de que eliminé ese archivo, ¡GnuPG volvió a funcionar a las mil maravillas!
Respuesta4
Agregar esta línea a mi .zshrc
funcionó para mí:
export GPG_TTY=$(tty)