繁体   English   中英

无法使用从其他机器导出的 GPG 密钥签署提交

[英]Cannot sign commit with exported GPG key from other machine

我需要 git 中的 gpg 密钥方面的帮助。 首先,我使用以下命令从 windows 导出密钥:

gpg --output backupkeys.pgp --armor --export-secret-keys --export-options export-backup user@email

然后在 linux 我导入这个密钥

gpg --import backupkeys.pgp 

并从未知变为终极。 所以这就是我将这个密钥导入 linux 的方式。 但现在我需要将 gpg 密钥添加到 git,所以我这样做:

git config --global user.signingkey mySuperKey

但是当我可以创建提交时

git commit -S -m "Super Commit" 

我有这个 output

error: gpg failed to sign the data
fatal: failed to write commit object

不知道哪里有问题。

在尝试导出新的 GPG 密钥并稍后导入之后。 我找到了这个问题的答案。

echo hello world | gpg -sa -u user@email

如果我尝试这样做,请不要显示:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

所以我需要做的就是:

export GPG_TTY=$(tty)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM