我无法在Linux中生成GPG密钥。
sudo gpg --gen-key # This is the command to try to generate key
错误
You need a Passphrase to protect your secret key.
gpg: problem with the agent: Timeout
gpg: Key generation canceled.
请告诉我哪里做错了。我无法在Linux中生成GPG密钥。
sudo gpg --gen-key # This is the command to try to generate key
错误
You need a Passphrase to protect your secret key.
gpg: problem with the agent: Timeout
gpg: Key generation canceled.
请告诉我哪里做错了。请查看此内容
1)运行gpg-agent命令:
gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
2)生成足够的熵
sudo rngd -r /dev/urandom
3) 最后运行gpg命令生成密钥:
gpg --gen-key
请使用非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*
我的私钥文件名为myprivatekey.txt,公钥文件名为mypublickey.txt。
使用同一用户导入密钥
User$ gpg --import myprivatekey.txt
现在尝试使用相同用户解密
gpg-agent[3745]: 警告: "--use-standard-socket" 是一个已过时的选项 - 它没有效果 gpg-agent[3745]: 目录 '/home/vscode/.gnupg/private-keys-v1.d' 已创建 gpg-agent: gpg-agent 已经在运行中 - 不启动新的实例。
- Damian