I'm trying to follow these guides and answers
- https://wiki.gnupg.org/AgentForwarding
- https://superuser.com/questions/161973/how-can-i-forward-a-gpg-key-via-ssh-agent
- https://gist.github.com/TimJDFletcher/85fafd023c81aabfad57454111c1564d
and anything else I can find to make this work:
- SSH from macOS to ubuntu 18.04
- Forward my local gpg agent so I can
gpg --decrypt
on the remote machine.
I already --export
ed and --import
ed my public key to the remote machine. The remote gpg reports the agent-socket to reside in
/run/user/1001/gnupg/S.gpg-agent
, and the extra socket in /run/user/1001/gnupg/S.gpg-agent.extra
.
However, trying to ssh -v -R /run/user/1001/gnupg/S.gpg-agent:/Users/rasmus/.gnupg/S.gpg-agent.extra -l rasmus <remote-host>
warns that
Warning: remote port forwarding failed for listen path /run/user/1001/gnupg/S.gpg-agent
Which is presumably because systemd already owns the remote socket.
$ sudo journalctl -xe
…
Mar 11 15:06:21 pact-cube sshd[4972]: error: bind: Address already in use
Mar 11 15:06:21 pact-cube sshd[4972]: error: unix_listener: cannot bind to path: /run/user/1001/gnupg/S.gpg-agent
What must I do to forward gpg agent from macOS to Ubuntu 18.04? The required GPG and SSH versions are used on both machines.