Skip to content

Allow pasting SSH keys longer than 400 characters in sshd setup - #14374

Closed
ArranzDavid wants to merge 1 commit into
omacom:quattrofrom
ArranzDavid:fix-sshd-long-key-paste
Closed

ArranzDavid wants to merge 1 commit into
omacom:quattrofrom
ArranzDavid:fix-sshd-long-key-paste

Conversation

@ArranzDavid

Copy link
Copy Markdown

gum input defaults to --char-limit=400, so pasting an RSA 3072/4096 key or an OpenSSH certificate into "Paste key manually" gets truncated and valid_key rejects it as Not a valid SSH public key.

Setting --char-limit=0 removes the limit.

Fixes #14351

gum input defaults to --char-limit=400, which truncates RSA 3072/4096
keys and certificates so valid_key rejects them. Fixes omacom#14351.
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Removes character limit on SSH key input in setup script.

This change appears safe to merge.

What we checked:

  • Pasted keys still get checked: No. authorize_pasted_key still calls authorize_key, which rejects keys that fail valid_key before writing them.

Summary

Removes the 400-character input limit when users paste an SSH public key manually.

  • Allows longer keys to reach the existing key check without truncation.
  • Keeps the empty-input check and the existing authorization flow.

Reviews (1) · Last reviewed commit: "Allow pasting SSH keys longer than 400 c..."

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks! It looks like #14352 makes the same change (--char-limit=0 on the "Paste key manually" input for #14351) and also adds a test with a 3072-bit RSA key. Could we pick one of the two? #14352 seems the more complete option, since it includes the test.

@ArranzDavid

Copy link
Copy Markdown
Author

Thanks for pointing that out, I missed #14352. It's the same fix, opened earlier and with a test, so I'm closing this one in its favor.

@ArranzDavid ArranzDavid closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

2 participants