Skip to content

SSH_AUTH_SOCK removed when running git commands #1940

@forsberg

Description

@forsberg

It looks like the code that decides what environment variables to pass on to git, used when trying the experimental eksctl enable repo command filters out the SSH_AUTH_SOCK environment variable.

https://github.com/weaveworks/eksctl/blob/191286ead564f30cd4ed75082111353a0d5edf42/pkg/git/git.go#L89

I'm using a Yubikey to store the private part of my ssh key, and filtering out SSH_AUTH_SOCK means this doesn't work at all.

For me, using gpg-agent as ssh-agent, a workaround is to create a /usr/local/bin/git with the following contents:

#!/bin/sh

if [ -z "$SSH_AUTH_SOCK" ] ; then
   export SSH_AUTH_SOCK=/run/user/$(id -u)/gnupg/S.gpg-agent.ssh
fi

exec /usr/bin/git "$@"

But I think the preferred solution is to not filter out SSH_AUTH_SOCK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions