From 4015999e13543998e0d120c7a4ef13069d1280dd Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Fri, 3 Nov 2023 19:30:12 +0000 Subject: [PATCH] Only forward gpg-agent socket over ssh if it exists. --- .ssh/config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ssh/config b/.ssh/config index 3b1ca37..738e162 100644 --- a/.ssh/config +++ b/.ssh/config @@ -8,12 +8,15 @@ ConnectTimeout 30 ExitOnForwardFailure yes ForwardAgent yes HashKnownHosts no -RemoteForward %d/.gnupg/S.gpg-agent ${HOME}/.gnupg/S.gpg-agent SendEnv LANG LC_* TERM StrictHostKeyChecking accept-new VerifyHostKeyDNS yes VisualHostKey yes +# Only forward the gpg-agent socket if it exists on the local host. +Match exec "[[ -e ${HOME}/.gnupg/S.gpg-agent ]]" + RemoteForward %d/.gnupg/S.gpg-agent ${HOME}/.gnupg/S.gpg-agent + # Home stuff. Host afterdark.org.uk Port 6722