如何在gpg-agent(YubiKey)中使用capistrano

有没有一种方法可以配置ruby net-ssh使用gpg-agent?我们在整个DevOps部门都使用YubiKeys,并且已经使用Capistrano配置了部署。到目前为止,使用RSA密钥,它们可以正常工作,但是现在它已停止工作,显然使用net-ssh的代理无法读取存储在本地计算机上的yubikey的公共密钥。

这是我得到的错误:

DEBUG -- net.ssh.transport.algorithms[2b2aac27fe50]: exchanging keys
DEBUG -- socket[2b2aac291470]: queueing packet nr 1 type 30 len 148
DEBUG -- socket[2b2aac291470]: sent 152 bytes
DEBUG -- socket[2b2aac291470]: read 376 bytes
DEBUG -- socket[2b2aac291470]: received packet nr 1 type 31 len 356
DEBUG -- socket[2b2aac291470]: queueing packet nr 2 type 21 len 20
DEBUG -- socket[2b2aac291470]: sent 24 bytes
DEBUG -- socket[2b2aac291470]: received packet nr 2 type 21 len 12
DEBUG -- net.ssh.authentication.session[2b2aac04e654]: beginning authentication of `borja'
DEBUG -- socket[2b2aac291470]: queueing packet nr 3 type 5 len 28
DEBUG -- socket[2b2aac291470]: sent 96 bytes
DEBUG -- socket[2b2aac291470]: read 96 bytes
DEBUG -- socket[2b2aac291470]: received packet nr 3 type 6 len 28
DEBUG -- net.ssh.authentication.session[2b2aac04e654]: trying none
DEBUG -- socket[2b2aac291470]: queueing packet nr 4 type 50 len 44
DEBUG -- socket[2b2aac291470]: sent 112 bytes
DEBUG -- socket[2b2aac291470]: read 96 bytes
DEBUG -- socket[2b2aac291470]: received packet nr 4 type 51 len 28
DEBUG -- net.ssh.authentication.session[2b2aac04e654]: allowed methods: publickey
DEBUG -- net.ssh.authentication.methods.none[2b2aac04b634]: none failed
DEBUG -- net.ssh.authentication.session[2b2aac04e654]: trying publickey
DEBUG -- net.ssh.authentication.agent[2b2aac029c3c]: connecting to ssh-agent
DEBUG -- net.ssh.authentication.agent[2b2aac029c3c]: sending agent request 1 len 48
DEBUG -- net.ssh.authentication.agent[2b2aac029c3c]: received agent packet 5 len 1
DEBUG -- net.ssh.authentication.agent[2b2aac029c3c]: sending agent request 11 len 0
DEBUG -- net.ssh.authentication.agent[2b2aac029c3c]: received agent packet 12 len 439
ERROR -- net.ssh.authentication.key_manager[2b2aac04a838]: could not load private key file `/home/****/.ssh/id_rsa_yubikey.pub': OpenSSL::PKey::PKeyError (Could not parse PKey: no start line)
ERROR -- net.ssh.authentication.session[2b2aac04e654]: all authorization methods failed (tried none,publickey)

手动SSH连接可以正常工作。

到目前为止,我已经尝试定义环境变量SSH_AUTH_SOCK来指向机器上的GPG代理。

ENV['SSH_AUTH_SOCK'] = "/run/user/1000/gnupg/S.gpg-agent.ssh"

但没有结果...

我找到了一些有关它的信息,但没有任何澄清。 可以配置它吗?

sixupiaofubud 回答:如何在gpg-agent(YubiKey)中使用capistrano

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2836814.html

大家都在问