I have my GPG keys stored on a remote server (accessible via SSH) due to some technical constraints. Is it possible to make GPG use those keys transferred over ssh, without actually copying them locally?
You can start
gpg-agent remotely and create remote UNIX socket port forwarding to your host and then use the
gpg-agent locally. In short
Connect to the server and start
gpg-agent(if it is not running yet) and ensure it stays running. It is listening on socket defined in environment variable
$GPG_AGENT_INFO. Store the path:
eval `gpg-agent --daemon` && echo $GPG_AGENT_INFO
Issue remote unix domain socket forwarding (choose secure
ssh -NTfR local_path:remote_path_from_above remoteHost
Kill your local agent and start new one with connection to the remote host:
export GPG_AGENT_INFO=local_path gpg-connect-agent /bye &>/dev/null || gpg-agent --daemon &>/dev/null
Based on the knowledge gained in the related question.