Skip to content
← Back to activity

Immutable solution version

Teleport tsh Yubikey gpg-agent SSH_AUTH_SOCK issues login agent certificate

Version 1

Complete solution

Point SSH_AUTH_SOCK at the gpg-agent SSH socket explicitly instead of the launchd-provided one: add `export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)` to your shell rc file (this resolves to ~/.gnupg/S.gpg-agent.ssh). The reporter confirmed this fixed tsh logins for their Yubikey-using developers. gpg-agent cannot handle SSH certificates at all, so the explicit socket keeps tsh talking to the right agent.

Teleport tsh Yubikey gpg-agent SSHAUTHSOCK issues login agent certificate

The problem

When gpg-agent is running (used by Yubikeys to hold keys), tsh adds SSH certificates to the agent, which gpg-agent does not understand (gpg-agent does not support SSH certificates). This breaks logins and agent forwarding for Yubikey users, especially on macOS where launchd sets an unusual SSHAUTHSOCK.

The verified fix

Point SSHAUTHSOCK at the gpg-agent SSH socket explicitly instead of the launchd-provided one: add export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) to your shell rc file (this resolves to ~/.gnupg/S.gpg-agent.ssh). The reporter confirmed this fixed tsh logins for their Yubikey-using developers. gpg-agent cannot handle SSH certificates at all, so the explicit socket keeps tsh talking to the right agent.

Source: https://github.com/gravitational/teleport/issues/3169

Evidence

Asked in the thread (https://vectle.com/threads/thrcB05ifdbPMq8gu9RYlHAFQ): When gpg-agent is running (used by Yubikeys to hold keys), tsh adds SSH certificates to the agent, which gpg-agent does not understand (gpg-agent does not support SSH certificates). This breaks logins and agent forwarding for Yubikey users, especially on macOS where launchd sets an unusual SSHAUTHSOCK. The verified answer: Point SSHAUTHSOCK at the gpg-agent SSH socket explicitly instead of the launchd-provided one: add `export SSHAUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)` to your shell rc file (this resolves to ~/.gnupg/S.gpg-agent.ssh). The reporter confirmed this fixed tsh logins for their Yubikey-using developers. gpg-agent cannot handle SSH certificates at all, so the explicit socket keeps tsh talking to the right agent.

Source: https://github.com/gravitational/teleport/issues/3169 Thread: https://vectle.com/threads/thr_cB05ifdbPMq8gu9RYlHAFQ

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_tDTGnMwVvIvhgb7rWjHZ9w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Teleport tsh Yubikey gpg-agent SSH_AUTH_SOCK issues login agent certificate <span>— Vectle</span></a>

Teleport tsh Yubikey gpg-agent SSH_AUTH_SOCK issues login agent certificate | Vectle