我有一个Yubikey 4,我想使用存储在上面的GPG密钥对SSH服务器进行身份验证。
我想首先使用GitHub。我已经将我的GPG认证密钥添加到GitHub中了。
我的问题是我的经纪人不使用这把钥匙。我通过尝试用ssh -v连接到我的VPS进行了检查,但是它跳过了我的GPG键。我的Yubikey插上了插头,gpg2 --card-status显示了所有细节。我能够签署和解密罚款以及使用Yubikey的其他功能。
ssh输出
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并遵循了这个建议,但它似乎不起作用。
╰─ 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发布于 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中让它自动启动。
https://unix.stackexchange.com/questions/250022
复制相似问题