Repository navigation
Enable gcr-ssh-agent by default so SSH keys work out of the box #8467
volfpeter
started this conversation in
Suggestions
Replies: 1 comment
|
Yes please! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I hit
Fresh Omarchy 4.0.1 install, passphrase-protected
~/.ssh/id_ed25519. SSH auth to GitHub never worked without manual setup, and it fails in a fairly opaque way:SSH_AUTH_SOCKis unset in the sessionssh-add -l→Could not open a connection to your authentication agentComing to Omarchy without an Arch background, this took a long time to work out. The relevant pieces are spread across systemd user units, a gnome-keyring split, and PAM, and none of it is discoverable from the symptom.
Why it's surprising
Omarchy already ships and configures most of what's needed:
install/user/default-keyring.shdeliberately pre-creates a blank-passwordDefault_keyringand makes it the default — an auto-unlocking secret store that matches autologininstall/config/ssh-keepalive.shships opinionated SSH client defaultsinstall/config/ssh-command-path.shtunes the PAMPATHfor SSH commandsinstall/user/first-run/enable-user-units.shalready enables user systemd units at first run, and its comment explains why first-run is the right momentBut there are no references anywhere in
/usr/share/omarchytossh-keygen,gcr-ssh-agent, orSSH_AUTH_SOCK. The secret store exists, the SSH client config exists, and the hook for enabling user units exists — but nothing ever makes an agent reachable.Relevant background: gnome-keyring ≥ 42 dropped its own
sshcomponent (it now runs--components=pkcs11,secrets). That role moved togcr-ssh-agent, which ships ingcr-4but is disabled by default on Arch.Suggestion A — enable the agent (no prompts, helps everyone)
Two changes:
gcr-ssh-agent.socketto the list ininstall/user/first-run/enable-user-units.shenvironment.ddrop-in withSSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/gcr/sshThis requires no user choice and helps anyone bringing an existing key.
gcr-ssh-agentpreloads~/.ssh/*.puband, on the first sign request for a key, runsssh-additself with the passphrase fetched from the keyring via libsecret. A passphrased key then unlocks silently — which is precisely what the blank-passwordDefault_keyringis already there to enable.I verified this end-to-end on my machine; it works with no other changes and no PAM edits.
One caveat worth designing for: 1Password's SSH agent sets its own
SSH_AUTH_SOCK, and Omarchy already knows about 1Password (omarchy-system-locklocks it). Numbering the drop-in low (e.g.10-ssh-agent.conf) keeps it overridable, sinceenvironment.dis read in lexical order.Suggestion B —
omarchy setup git sshomarchy setup security sshd --key=<pubkey>already covers the server side. The client side is missing. A command that generates~/.ssh/id_ed25519when absent, then either runsgh ssh-key add(whenghis available) or prints the public key, would close the last mile.I'd suggest this as an
omarchy setup ...command rather than an installer prompt: re-runnable, doesn't add to first boot, and stays forge-agnostic for GitLab/Gitea/Forgejo users.On passphrases: if Omarchy ever generates a key, I'd suggest defaulting to no passphrase. With autologin plus a blank-password keyring plus LUKS, a passphrase stored in an unlocked keyring adds very little — the key and its passphrase end up side by side in the same home directory. It's worth an opt-in flag for people who disable autologin or sync keys into backups, but as a default it looks more protective than it is.
Naming note:
install/user/first-run/setup-agent.hookalready exists and refers to AI agents, so a new SSH command should avoid colliding with that name.System
All reactions