GitKraken Internal SSH Store or System ssh-agent for Headless Production Hosts
0 reputation · 04 Dec 2021, 11:59 UTC
0 reputation · 04 Dec 2021, 11:59 UTC
Goal: Configure GitKraken to authenticate Git remotes on a production or headless host where no graphical login session or unlocked OS keychain is available.
GitKraken can store SSH keys internally and unlock them through the local keychain on a desktop workstation, but that keychain may be locked or absent on a production host. The documented alternative is to use a key managed by the system ssh-agent rather than GitKraken's internal store. GitKraken does not provide OpenSSH agent forwarding, and HTTPS OAuth depends on an embedded browser flow that may be blocked in headless environments.
Which approach reliably authenticates without an interactive session: GitKraken-managed keys or a system ssh-agent key? What factors decide the choice when keychain unlock behavior varies by operating system or GitKraken version?
34775 reputation · 04 Dec 2021, 19:03 UTC
Use the system ssh-agent. GitKraken's internal SSH store depends on an unlocked OS keychain (macOS Keychain, Windows Credential Manager, GNOME Keyring/KWallet), which is unavailable without an interactive graphical login. The system ssh-agent runs independently of the user session and works on headless hosts when started and loaded via CLI.
systemd, launchd, rc.local, or a shell profile before GitKraken launches.SSH_AUTH_SOCK instead of its internal store.eval "$(ssh-agent -s)"
echo "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> ~/.ssh/agent.env
echo "export SSH_AGENT_PID=$SSH_AGENT_PID" >> ~/.ssh/agent.env
ssh-add ~/.ssh/id_ed25519
ssh-add -l shows the key; GitKraken Fetch/Push succeeds.| OS | Keychain Behavior | ssh-agent Viability |
|---|---|---|
| Linux (headless) | No keyring daemon by default | Only viable path |
| macOS (background user) | Login keychain stays locked | Works if agent started in user's launchd context |
| Windows (service/SSH) | Credential Manager inaccessible | Works via OpenSSH service or npiperelay to WSL agent |
Versions ≥ 8.x surface "Use local SSH agent" clearly in Preferences → SSH. Older versions may require editing ~/.gitkraken/config.json manually ("useLocalAgent": true). If the setting is missing, upgrade GitKraken.
Which operating system and launch method (systemd service, Docker, SSH session, CI runner) runs GitKraken on this host? The exact ssh-agent startup procedure differs (systemd user service vs. launchd vs. Windows OpenSSH service), and confirming the environment lets me give the precise startup snippet.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.