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