Skip to content

Fix host key verification failure for clush console type#2141

Merged
berendt merged 1 commit intomainfrom
fix-keys
Mar 16, 2026
Merged

Fix host key verification failure for clush console type#2141
berendt merged 1 commit intomainfrom
fix-keys

Conversation

@berendt
Copy link
Copy Markdown
Member

@berendt berendt commented Mar 16, 2026

The clush SSH options were missing StrictHostKeyChecking=no and LogLevel=ERROR, causing "Host key verification failed" errors on all clush connections.

Will be improved by #2140 in the future.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider passing each SSH option as a separate list element instead of concatenating them into a single formatted string, to avoid quoting/spacing issues and make future changes less error-prone.
  • Disabling StrictHostKeyChecking globally for this console type has security implications; it may be worth making this behavior configurable so environments that require host key verification can opt in or out explicitly.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider passing each SSH option as a separate list element instead of concatenating them into a single formatted string, to avoid quoting/spacing issues and make future changes less error-prone.
- Disabling StrictHostKeyChecking globally for this console type has security implications; it may be worth making this behavior configurable so environments that require host key verification can opt in or out explicitly.

## Individual Comments

### Comment 1
<location path="osism/commands/console.py" line_range="229" />
<code_context>
                         settings.OPERATOR_USER,
                         "-o",
-                        f"-o UserKnownHostsFile={tmp_known_hosts}",
+                        f"-o StrictHostKeyChecking=no -o LogLevel=ERROR -o UserKnownHostsFile={tmp_known_hosts}",
                         "-g",
                         host,
</code_context>
<issue_to_address>
**issue (bug_risk):** Multiple ssh -o options are combined into a single argv element, which ssh will not parse as intended.

Since this is one argv element, ssh parses it as `-o` with a single value (`StrictHostKeyChecking=no -o LogLevel=ERROR -o UserKnownHostsFile=...`). Only `StrictHostKeyChecking=no` is applied; the rest are ignored as separate options. These should be passed as distinct arguments instead, e.g. `"-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR", "-o", f"UserKnownHostsFile={tmp_known_hosts}"` so all options take effect.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread osism/commands/console.py Outdated
The clush SSH options were missing StrictHostKeyChecking=no and
LogLevel=ERROR, causing "Host key verification failed" errors on
all clush connections.

Will be improved by #2140 in the future.

Signed-off-by: Christian Berendt <berendt@osism.tech>
@berendt berendt merged commit 669e7e4 into main Mar 16, 2026
3 checks passed
@berendt berendt deleted the fix-keys branch March 16, 2026 12:24
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.

1 participant