首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gpg-agent代替ssh-agent

gpg-agent代替ssh-agent
EN

Unix & Linux用户
提问于 2015-12-17 18:59:46
回答 1查看 6.3K关注 0票数 5

我有一个Yubikey 4,我想使用存储在上面的GPG密钥对SSH服务器进行身份验证。

我想首先使用GitHub。我已经将我的GPG认证密钥添加到GitHub中了。

我的问题是我的经纪人不使用这把钥匙。我通过尝试用ssh -v连接到我的VPS进行了检查,但是它跳过了我的GPG键。我的Yubikey插上了插头,gpg2 --card-status显示了所有细节。我能够签署和解密罚款以及使用Yubikey的其他功能。

ssh输出

代码语言:javascript
复制
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/wilhelm/.ssh/id_rsa
debug1: Trying private key: /home/wilhelm/.ssh/id_dsa
debug1: Trying private key: /home/wilhelm/.ssh/id_ecdsa
debug1: Trying private key: /home/wilhelm/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

我已经禁用了gnome密码管理器。

我看过将SSH和Git连接到gpg-agent并遵循了这个建议,但它似乎不起作用。

代码语言:javascript
复制
╰─ ssh-add -l
Could not open a connection to your authentication agent.

╰─ ps aux | grep gpg-agent
wilhelm  26079  0.0  0.0  20268   980 ?        Ss   20:57   0:00 gpg-agent --daemon --enable-ssh-support --sh
wilhelm  31559  0.0  0.0  12724  2184 pts/1    S+   22:49   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn gpg-agent
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2015-12-17 21:02:14

ssh无法打开到您的gpg-agent的连接,如果您不给它这样做的话。

当您使用gpg-agent选项启动--enable-ssh-support时,它会打印出需要在shell中使用ssh的环境变量。如何获得这些信息的可能性不多:

  • 停止您的gpg-agent,并在shell中再次启动它,在其中您正在使用您的ssh (这应该是测试它的最简单方法):eval $(gpg-agent -daemon-启用-ssh-support-sh)
  • 查找身份验证套接字的位置并手动设置环境变量SSH_AUTH_SOCK

稍后,当您知道它可以工作时,您应该根据gpg-agent(1)的手册页面设置代理start,所以可能在~/.xsession中让它自动启动。

票数 4
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/250022

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档