Repository navigation
fix: name the SSH user when a new device rejects every key - #737
Merged
Merged
Conversation
Contributor
Author
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryThe key-login offer now names the resolved SSH user when the target leaves it out.
Reviews (2) · Last reviewed commit: "fix: name the SSH user when a new device..." · Reviewed by Greptile |
An Add Device target without a user (`host.example`) logs in as the local account, so a host that only knows `pi@host.example` refuses every key and the dialog offered to run ssh-copy-id for the wrong account, with no sign of which user was tried. The host claim already holds the `ssh -G` destination, so the key offer now names that user when the target does not, and suggests the target with a user (inside the URI for an `ssh://` target). Targets that name their user keep the existing text. No extra process or connection is made. Editing the target while an offer is shown now returns the dialog to the form and drops the claim, so following the hint checks the new target instead of installing a key for the account that was refused.
theontho
force-pushed
the
fix/ssh-key-login-names-user
branch
from
October 20, 2026 16:55
7777e5b to
c266a1c
Compare
Owner
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an Add Device target has no user (for example
rpi4-hermes.taile584c3.ts.net),sshlogs in as the local account. If the host only accepts the key for another account (pi@…), the probe hitsPermission denied (publickey)and the dialog says "accepted none of your SSH keys". It then offers to runssh-copy-idfor the wrong account and never says which user it tried. Plainssh pi@hostworks, so the message is misleading.ssh -G-resolved destination. When the target doesn't name a user, the key offer now names the resolved one and suggests the target with a user. For anssh://target the user goes inside the URI (ssh://name@box:2222).Screenshots
There are no native screenshots yet. Driving a second app instance through synthesized input wasn't safe on a desktop that was in use, so no capture was taken. The change is text in the existing status line of the key offer, plus the dialog returning to its form.
QA
cargo test -p herdr-gpui --locked --bins menu::devices: 125 passed. Newkey_logintests cover the implied user, explicituser@/ssh://user@targets, anssh://target without a user, no resolved user, and target edits withdrawing the offerjust cion c266a1c, macOS arm64: passed. An earlier run under heavy load hit two timing flakes unrelated to this change (login_env::…timeout_kills_shell_and_descendant_group,updater::brew::…relaunch_retries_then_alerts_when_open_keeps_failing); both passed when rerunjust run, macOS arm64), with a target that has no user, for a host that only acceptspi@: the probe failed withAuthand the offer named the local userpi@…and pressed Enter: the host was checked again (Running) and the device saved throughmachine addwithout a key install, then was removed