I recently ran into an issue where I was having problems creating a new set of GPG keys on a CentOS host that I was using. Here is the process that eventually worked for me.
1. Run the following gpg-agent command:
gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
2. Run the following rngd command to ensure there is enough entropy being generated:
sudo rngd -r /dev/urandom
3. Finally run the gpg command to generate the key:
gpg --gen-key
If you are running the gpg-agent as root you may run into other issue that prevent you from completing the process. It is best to run as a non-root user.
Nate
I was having a similar problem. The error I was getting is below:
ReplyDelete---
GnuPG needs to construct a user ID to identify your key.
Real name: xxxxx
Email address:
Comment:
You selected this USER-ID:
"xxxxx"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
gpg: cancelled by user
gpg: Key generation canceled.
---
Basically, it was cancelling without letting me enter a password.
The problem turned out to be that I was su'ing from root into a user account. You need to log in directly as the user before running gpg --gen-key (don't use su).
Thanks for the comment, I was going crazy with this!!!!
DeleteIt worked for me too!
No more "su - USER" when creating keys.
This comment has been removed by the author.
Deletethanks buddy, yes su - user is the problem,
ReplyDeleteDirect login works for me too.
Regards,
Parag Gaur
This comment has been removed by the author.
ReplyDeletekuşadası
ReplyDeletegiresun
tunceli
ısparta
kırıkkale
SİVW