Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh Debian上的GPG密钥转发_Ssh_Debian_Smartcard_Gnupg_Openpgp - Fatal编程技术网

Ssh Debian上的GPG密钥转发

Ssh Debian上的GPG密钥转发,ssh,debian,smartcard,gnupg,openpgp,Ssh,Debian,Smartcard,Gnupg,Openpgp,我正试图使用我的openpgp卡的私钥,从我的Debian笔记本电脑到RPi。我遵循了谷歌上的不同提示,尤其是: ~/.gnupg/gpg agent.conf中的额外套接字 当发现将在/run/user//gnupg 使用~/.ssh/config 主机homegear 主机名homegear RemoteForward~/.gnupg/S.gpg-agent/run/user/1000/gnupg/S.gpg-agent.extra 更改了RemoteForward线路中两个套接字

我正试图使用我的openpgp卡的私钥,从我的Debian笔记本电脑到RPi。我遵循了谷歌上的不同提示,尤其是:

  • ~/.gnupg/gpg agent.conf中的额外套接字
  • 当发现将在
    /run/user//gnupg
  • 使用
    ~/.ssh/config

主机homegear
主机名homegear
RemoteForward~/.gnupg/S.gpg-agent/run/user/1000/gnupg/S.gpg-agent.extra

  • 更改了RemoteForward线路中两个套接字的顺序,因为我总是不知道哪一个应该是第一个
  • 将以下内容添加到RPi的
    /etc/ssh/sshd_config

StreamLocalBindUnlink是

  • 在笔记本电脑上重新加载gpg代理
  • 打开到RPi的新ssh连接
但我总是会

Warning: remote port forwarding failed for listen path ~/.gnupg/S.gpg-agent
连接到RPi时

笔记本电脑和RPi上的
openssh
都是7.4(Debian Stretch),
gpg
是2.1.18。 转发代理连接以用作ssh私钥(用于从RPi连接到gitlab)工作得很好,转发gpg私钥(用于签名提交)则不行。我现在有点无助。有什么明显的问题吗?或者转发unix域套接字仍然存在问题,我需要使用socat解决方案


谢谢大家!

除了在运行10.14.2和GPG 2.2.11的两台Mac电脑之间,我遇到了完全相同的问题,唯一能让它工作的方法是指定两端插槽的绝对路径:(远程或本地套接字都有一个相对路径,但都以各种方式失败,如果您在不同的机器上以不同的用户名连接,这会让您感到有点痛苦

我可以通过在我的
~/.ssh/config
中指定许多不同的
Match exec
块来解决这个问题:

# Source machine is a personal Mac, connecting to another personal Mac on my local network
Match exec "hostname | grep -F .core" Host *.core
    RemoteForward /Users/virtualwolf/.gnupg/S.gpg-agent /Users/virtualwolf/.gnupg/S.gpg-agent.extra

# Source machine is a personal Mac, connecting to my Linux box
Match exec "hostname | grep -F .core" Host <name of the host block for my Linux box>
    RemoteForward /home/virtualwolf/.gnupg/S.gpg-agent /Users/virtualwolf/.gnupg/S.gpg-agent.extra

# Source machine is my work Mac, connecting to my Linux box
Match exec "hostname | grep -F <work machine name>" Host <name of the host block for my Linux box>
    RemoteForward /home/virtualwolf/.gnupg/S.gpg-agent /Users/<work username>/.gnupg/S.gpg-agent.extra
#源计算机是一台个人Mac,连接到本地网络上的另一台个人Mac
匹配exec“hostname | grep-F.core”主机*.core
RemoteForward/Users/virtualwolf/.gnupg/S.gpg-agent/Users/virtualwolf/.gnupg/S.gpg-agent.extra
#源计算机是一台个人Mac,连接到我的Linux机器
匹配exec“hostname | grep-F.core”主机
RemoteForward/home/virtualwolf/.gnupg/S.gpg-agent/Users/virtualwolf/.gnupg/S.gpg-agent.extra
#源计算机是我的工作Mac,连接到我的Linux机器
匹配exec“主机名| grep-F”主机
RemoteForward/home/virtualwolf/.gnupg/S.gpg-agent/Users/.gnupg/S.gpg-agent.extra
(SSH位取自)