Skip to content

Accept full SSH public keys pasted into sshd setup - #14352

Open
z23 wants to merge 4 commits into
omacom:quattrofrom
z23:fix/sshd-paste-key-limit
Open

z23 wants to merge 4 commits into
omacom:quattrofrom
z23:fix/sshd-paste-key-limit

Conversation

@z23

@z23 z23 commented Oct 6, 2026

Copy link
Copy Markdown

Fixes #14351

gum input defaults to --char-limit=400. omarchy setup security sshd uses that prompt for "Paste key manually", then checks the result with ssh-keygen -lf. A 3072-bit RSA public key is about 570 characters, so the prompt keeps a prefix, ssh-keygen rejects it, and the command prints "Not a valid SSH public key". An OpenSSH certificate is longer still. Ed25519 keys fit, which is why the placeholder example works.

The public-key prompt now passes --char-limit=0 (no limit). The GitHub username prompt is unchanged.

The sshd setup test stubs gum with that 400-character ceiling, pastes a generated 3072-bit key, and checks that authorized_keys receives the whole line and password logins are still turned off. The same case fails on the old prompt.

gum input stops at 400 characters, so a 3072-bit RSA key or an OpenSSH
certificate is truncated and reported as invalid.
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Removes the character limit from the SSH public-key prompt so users can paste long keys.

  • The SSH setup prompt now accepts full-length pasted keys.

Reviews (3) · Last reviewed commit: "Merge quattro into fix/sshd-paste-key-li..." · Reviewed by Greptile

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything seems fine, ready to merge.

omarchybot and others added 2 commits October 16, 2026 03:44
quattro moved the public-key prompt to omarchy-i18n; keep that prompt and add --char-limit=0 to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since quattro localized the sshd prompts, the paste path calls omarchy-i18n to build its menu and prompt. Without $ROOT/bin on PATH and OMARCHY_PATH pinned, the test used whatever Omarchy the machine had installed, and failed where none was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified. The fix is right: gum input stops at 400 characters by default (gum input --help on gum 2.0.2), so a 3072-bit RSA key pasted at the prompt was truncated and ssh-keygen rejected it. --char-limit=0 on that prompt alone is the proportionate fix.

This branch conflicted with quattro, which has since moved the sshd prompts to omarchy-i18n, so I pushed two commits to it:

  • ef055e1 merges quattro and keeps the localized $(omarchy-i18n sshd.publicKeyPrompt) prompt with --char-limit=0 added.
  • 3bd4d7e runs the new pasted-key case with OMARCHY_PATH="$ROOT" and $ROOT/bin on PATH. Since the i18n change, that path calls omarchy-i18n to build its menu and prompt, and without this the test used whatever Omarchy was installed on the machine running it, failing where none was.

On a fresh Omarchy worker VM at 3bd4d7e: test/shell.d/setup-security-sshd-test.sh passes, including with no installed Omarchy on PATH, and fails with --char-limit=0 removed (the truncated ssh-rsa key is reported as invalid). ./test/cli is green.

Second opinion: Codex Medium, over two rounds. The first found the test's dependency on an installed omarchy-i18n that the second commit fixes; the second round on this head found nothing open.

It closes #14351 and now waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 2, 2026
quattro's omacom#14667 rewrote the sshd setup test with its own gum stub for a cancelled prompt, which conflicted with this branch's stub. The test file is taken from quattro as is, dropping this branch's pasted-key case: its gum stub supplied the 400-character limit the case tested, and it grepped for the flag the fix adds, both against AGENTS.md's test rules. The fix itself, --char-limit=0 on the public-key prompt, merges cleanly onto quattro's reordered script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

@z23 this branch conflicted with quattro again, so I merged quattro into it and pushed the merge as 68a83a3.

The conflict was only in test/shell.d/setup-security-sshd-test.sh. #14667 rewrote that file with its own gum stub for a cancelled-prompt case. I took quattro's version of the file as it stands and dropped this branch's pasted-key case. That case's gum stub supplied the 400-character limit it was testing, and it grepped for the flag the fix adds. quattro's AGENTS.md now rules out both ("Don't test your own stub", "Don't restate the implementation"). Your fix, --char-limit=0 on the public-key prompt, merged cleanly onto #14667's reordered script, so the pull request is now that one line and its comment. The last paragraph of the description still describes the dropped test and no longer applies.

Checked on a fresh Omarchy worker VM, using the real gum 2.0.2 under a pty and the real "paste key" menu path, with a 567-character 3072-bit RSA key:

  • quattro at 3b36b9e: gum cuts the key to exactly 400 characters, and the script fails with "Not a valid SSH public key".
  • 68a83a3 with --char-limit=0 removed: the same failure.
  • 68a83a3: the full key is written to authorized_keys, password logins are turned off, and sshd starts.

test/shell.d/setup-security-sshd-test.sh (6 passed) and ./test/cli are green on the worker at 68a83a3. None of the shell tests cover the character limit; the worker reproduction is the evidence for it.

Second opinion: Codex Medium and muse-wonder (via pi, thinking high) both reviewed 68a83a3 and found nothing open. Both agreed the merge keeps all of #14667, that dropping the stub test follows quattro's test rules, and that no other prompt in Omarchy takes a pasted SSH key through gum input. They had access to my reasoning, so their agreement isn't fully independent.

It still closes #14351 and now waits on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pasting an RSA public key into sshd setup is rejected as invalid

3 participants