Enable SSH host key verification when gateway provides fingerprint#4
Merged
persimmon16 merged 1 commit intofeat/apple-containerfrom Apr 1, 2026
Merged
Conversation
When the gateway provides a host_key_fingerprint in CreateSshSessionResponse, write a temporary known_hosts file and enable StrictHostKeyChecking=yes. When the fingerprint is empty (current default), behavior is unchanged. This is scaffolding for F10/F11 — once the gateway populates the fingerprint field, MITM protection activates automatically in both CLI and TUI.
persimmon16
added a commit
that referenced
this pull request
Apr 1, 2026
… leak Three bugs from the initial SSH host-key PR (#4): 1. known_hosts wrote [sandbox]:2222 but SSH connects to "sandbox" at default port 22 — entry never matched, defeating StrictHostKeyChecking. Fixed to use bare "sandbox" hostname. 2. tempfile crate was only in [dev-dependencies] for openshell-cli, breaking release builds. Moved to [dependencies]. 3. TempDir::into_path() disabled automatic cleanup, leaking temp directories. Changed to return the TempDir guard so callers keep it alive until SSH exits, then cleanup runs on drop. Also fixes borrow-checker error in grpc.rs auth check (PR #5) where .ok_or_else() borrowed request while into_inner() tried to move it.
5 tasks
persimmon16
added a commit
that referenced
this pull request
Apr 1, 2026
* Fix SSH host key verification: hostname format, tempfile dep, TempDir leak Three bugs from the initial SSH host-key PR (#4): 1. known_hosts wrote [sandbox]:2222 but SSH connects to "sandbox" at default port 22 — entry never matched, defeating StrictHostKeyChecking. Fixed to use bare "sandbox" hostname. 2. tempfile crate was only in [dev-dependencies] for openshell-cli, breaking release builds. Moved to [dependencies]. 3. TempDir::into_path() disabled automatic cleanup, leaking temp directories. Changed to return the TempDir guard so callers keep it alive until SSH exits, then cleanup runs on drop. Also fixes borrow-checker error in grpc.rs auth check (PR #5) where .ok_or_else() borrowed request while into_inner() tried to move it. * Install Apple Container in macOS e2e workflow The macos-15 runner doesn't ship with Apple Container pre-installed. Download the signed .pkg installer from the GitHub release and install it before running container system info.
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
StrictHostKeyChecking=yeswith a temporaryknown_hostsfile when the gateway'shost_key_fingerprintfield is populatedAffects: CLI (
openshell-cli), TUI (openshell-tui)Test plan
cargo build -p openshell-cli -p openshell-tuisucceeds