I'm not able to generate GPG keys in linux
sudo gpg --gen-key # This is the command to try to generate key
error
You need a Passphrase to protect your secret key.
gpg: problem with the agent: Timeout
gpg: Key generation canceled.
Please let me know where I'm doing wrong
Open TerminalTerminalGit Bash. Use the gpg --list-secret-keys --keyid-format=long command to list the long form of the GPG keys for which you have both a public and private key.
Please check with this
1) Run the gpg-agent command:
gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
2) Generate enough entropy
sudo rngd -r /dev/urandom
3) Finally run the gpg command to generate the key:
gpg --gen-key
please run all commands with non-root user only
Please login with same user,which is used to create gpg keys.
1.We will export both our public key and private key as follows:
user$ gpg --export -a -o mypublickey.txt [email protected]
user$ gpg --export-secret-key -a -o myprivatekey.txt [email protected]
user$ ls my*
myprivatekey.txt mypublickey.txt
Import keys with same user
User$ gpg --import myprivatekey.txt
now try decrypt with same user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With