use*_*003 6 linux gpgpu gnupg gpgme
我无法在linux中生成GPG密钥
sudo gpg --gen-key # This is the command to try to generate key
Run Code Online (Sandbox Code Playgroud)
错误
You need a Passphrase to protect your secret key.
gpg: problem with the agent: Timeout
gpg: Key generation canceled.
Run Code Online (Sandbox Code Playgroud)
请告诉我我在哪里做错了
请检查一下
1)运行gpg-agent命令:
gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
Run Code Online (Sandbox Code Playgroud)
2)生成足够的熵
sudo rngd -r /dev/urandom
Run Code Online (Sandbox Code Playgroud)
3)最后运行gpg命令生成密钥:
gpg --gen-key
Run Code Online (Sandbox Code Playgroud)
请仅使用非root用户运行所有命令
请使用相同的用户登录,该用户用于创建gpg密钥.
1.我们将导出我们的公钥和私钥如下:
user$ gpg --export -a -o mypublickey.txt user@replaceurmail.com
user$ gpg --export-secret-key -a -o myprivatekey.txt user@replaceurmail.com
user$ ls my*
Run Code Online (Sandbox Code Playgroud)
myprivatekey.txt mypublickey.txt
用同一用户导入密钥
User$ gpg --import myprivatekey.txt
Run Code Online (Sandbox Code Playgroud)现在尝试用同一个用户解密