Repository navigation
Add SSH Agent (gcr-ssh-agent) as an optional service install - #9399
Conversation
Enables gcr-ssh-agent (already shipped via the gnome-keyring dependency) so passphrase-protected SSH keys work from any context: the agent prompts graphically on first use, with opt-in passphrase storage in the keyring. Adds install/remove commands and Install > Service / Remove > Service menu entries. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BReZWvvLsDRUaqgjiRzvZ5
|
I arrived here because I have been fighting my agents all day about pushing with my key that has a passphrase. This is the solution we would have invented (and probably have to implement manually until this releases). I sure hope this merges. |
seanpk
left a comment
There was a problem hiding this comment.
fwiw, and assuming that it won't be mergeable without a maintainer approving it, I approve.
The socket's ExecStartPost exports SSH_AUTH_SOCK into the user manager with set-environment, which disabling the socket does not undo, so apps launched after removal still pointed at a stopped agent. The environment.d file also has to be deleted before disable reloads the manager, or the generator re-exports it. Only an SSH_AUTH_SOCK pointing at gcr is cleared, so another agent's stays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed at c33cb3b. The service does what the description says; one defect in removal is fixed on the branch, and three things are left for the maintainer below. What was run. On a fresh Omarchy VM, with this branch merged onto current
Pushed: c33cb3b, removal now clears the agent from the session. The socket unit's Found, not changed:
Second opinion: Codex at medium effort, three rounds. Round one raised the removal defect and the plaintext keyring, and both held up when checked on the VM. Round two, on the fix, suggested Waiting on: the maintainer, to decide whether to take the service and whether the keyring point needs a warning. Nothing is needed from the author. |
Turning on an SSH agent is security configuration of the machine rather than installing software, so it sits with SSHD and the other Setup > Security entries. It hides once enabled, as Sudoless Docker does, and Remove > Service > SSH Agent turns it back off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Moved at the maintainer's request: SSH Agent setup now lives under Setup > Security > SSH Agent instead of Install > Service. Turning on an agent configures how the machine handles your keys. Nothing gets installed, since gcr-ssh-agent already ships with gnome-keyring, so it belongs next to SSHD. Pushed: f14b934
Checked on a worker built from the Omarchy ISO, with this head merged onto current
Second opinion (Codex Medium): found no defects in the move. It could not find any remaining reference to the old command name or menu id. It confirmed that the negated
|
…9399) * Add SSH Agent as an optional service install Enables gcr-ssh-agent (already shipped via the gnome-keyring dependency) so passphrase-protected SSH keys work from any context: the agent prompts graphically on first use, with opt-in passphrase storage in the keyring. Adds install/remove commands and Install > Service / Remove > Service menu entries. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BReZWvvLsDRUaqgjiRzvZ5 * Clear the agent's SSH_AUTH_SOCK when removing the SSH agent service The socket's ExecStartPost exports SSH_AUTH_SOCK into the user manager with set-environment, which disabling the socket does not undo, so apps launched after removal still pointed at a stopped agent. The environment.d file also has to be deleted before disable reloads the manager, or the generator re-exports it. Only an SSH_AUTH_SOCK pointing at gcr is cleared, so another agent's stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Move SSH Agent setup to Setup > Security Turning on an SSH agent is security configuration of the machine rather than installing software, so it sits with SSHD and the other Setup > Security entries. It hides once enabled, as Sudoless Docker does, and Remove > Service > SSH Agent turns it back off. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: David Heinemeier Hansson <[email protected]>
This PR is the optional service installation for everyone who doesn't run 1Password (or Bitwarden) as their SSH agent.
Out of the box, a passphrase-protected SSH key only works in an interactive terminal: anything without one (IDEs, coding agents, GUI apps) has nowhere to ask for the passphrase, so SSH pushes just fail. #1661 proposed adding ssh-agent for this, and @dhh's take was:
Unlike #1661, which wires up plain ssh-agent, this uses gcr-ssh-agent (already installed on every Omarchy machine via gnome-keyring) which can prompt graphically from any context and needs no ~/.ssh/config changes
What it does
Setup > Security > SSH Agent enables
gcr-ssh-agentand pointsSSH_AUTH_SOCKat it viaenvironment.d. On first use of a key, a dialog prompts for the passphrase:The key stays unlocked in the agent for the rest of the session. The checkbox is opt-in: nothing is persisted unless the user chooses to remember the passphrase in the keyring (which unlocks at login). A matching Remove > Service entry undoes everything.
Testing
install/remove round-trips, menu show/hide conditions, and end-to-end
ssh -T [email protected]from a context with no terminal attached.test/clipasses.