Skip to content

fix(windows): let normal users launch SSH runs - #915

Merged
small-angel merged 6 commits into
mainfrom
clo/windows-ssh-normal-users
Nov 5, 2026
Merged

small-angel merged 6 commits into
mainfrom
clo/windows-ssh-normal-users

Conversation

@small-angel

Copy link
Copy Markdown
Contributor

With the run engine off, every SSH launch failed for a normal (non-elevated) Windows user with "Could not start the SSH monitoring service". The service's private directory was locked down with PowerShell Set-Acl, which also rewrites the SACL and needs SeSecurityPrivilege. It's now a native Win32 call that writes only the DACL, with the same owner check and the same owner-only access.

Two smaller Windows fixes ride along. Password prompts no longer pop a blank orx.exe console window: askpass ssh commands get CREATE_NO_WINDOW, while batch logins keep DETACHED_PROCESS so a ProxyJump hop can't hang on invisible input. And key-only hosts now offer Connect when the old launcher needs it, where the SSH page only had Test and the CLI was the only way out.

Proved on a fresh Windows 11 VM as a non-elevated user against a real SSH host: setting-off launch, exit 7, cancel, killed sessions + one Connect, setting on, askpass with no window, key-host Connect, all pass. main fails the first one. fmt, clippy (also for the Windows target), cargo test both engine modes and the ui/ checks pass on macOS. Not covered: the installed app, a release MSVC build, real MFA, Windows 10.

Reviewed with sol-loop: 1 round with gpt-6.1-sol.

Fixes ORX-652
Fixes ORX-642
Closes #824

Assisted-by: claude-opus-5.5
Assisted-by: gpt-6.1-sol

With the old launcher, SSH failed for every non-elevated Windows user: the
spawned `orx ssh-service` re-ran a PowerShell Get-Acl/Set-Acl step and died with
"The process does not possess the 'SeSecurityPrivilege' privilege", which
surfaced as "Could not start the SSH monitoring service". Set-Acl rewrites the
SACL as well as the DACL, and only the second run hit it, so the first launch
of the directory looked healthy.

Direct Win32 calls write the DACL alone and drop a powershell.exe spawn from
every service start. The owner check and the protected, inherited
FullControl-for-the-current-user DACL match the script.

Closes #824

Assisted-by: claude-opus-5.5
Each SSH password prompt opened a blank window titled orx.exe. The engine spawns
ssh with DETACHED_PROCESS, so ssh has no console to hand on, and Windows gives
its console-subsystem askpass child a new, visible one.

CREATE_NO_WINDOW applies only to ssh commands that use askpass. Batch logins
keep DETACHED_PROCESS on purpose: with a hidden console, a ProxyJump hop that
ignores BatchMode would wait forever on input nobody can type, where today it
fails. Askpass commands are safe because the hop inherits askpass too.

Assisted-by: claude-opus-5.5
On Windows the old launcher logs in only through Connect, even with a key, so a
key host with the new engine off failed launches with "Use Connect" while the
SSH page offered only Test. The CLI was the only way out.

The server reports connectRequired from the same check Connect uses, so a key
host with a live old-launcher run keeps Connect after the setting is turned on.
A new field keeps `class` meaning what the engine classified.

Assisted-by: claude-opus-5.5
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect Windows SSH launch and host-connection workflows.

Fix the Windows test expectation before merging so the suite passes with the engine enabled.

Findings

  1. P1 Windows engine tests fail ▶
Fix with agent prompt
### Issue 1
src/commands/up/api_v2/tests.rs:1714
On Windows, this assertion fails with `ORX_RUN_ENGINE=1` or in a canary build. The fixture inserts only a `submitting` run, which `list_active_runs()` excludes. With the engine enabled, `supervised_ssh_needed()` therefore returns `false`, so the server correctly returns `connectRequired: false`, but the test expects `true`.

Test both settings in isolated child processes and assert the matching value.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR fixes Windows SSH startup for normal users.

  • Normal Windows users can start the SSH monitoring service.
  • Windows SSH password prompts no longer open a blank console.
  • SSH settings offer Connect when the Windows login route is needed.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Windows SSH launch] --> B[Check directory owner]
  B --> C[Grant current user access]
  C --> D[Start SSH monitoring service]
  E[Host settings] --> F{Old launcher needed?}
  F -->|Yes| G[Offer Connect]
  F -->|No| H[Keep key-host Test or Retry]
Loading

Reviews (1) · Last reviewed commit: "fix(ssh): offer Connect on key hosts whe..." · Reviewed by Greptile

Comment thread src/commands/up/api_v2/tests.rs Resolved
With the engine setting on, a submitting run alone does not need the
old launcher, so key hosts report connectRequired false on Windows.

Assisted-by: claude-opus-5.5
@small-angel
small-angel merged commit 9a5693a into main Nov 5, 2026
12 checks passed
@small-angel
small-angel deleted the clo/windows-ssh-normal-users branch November 5, 2026 23:36
@myles332 myles332 mentioned this pull request Nov 6, 2026
3 of 5 tasks
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.

Windows SSH compute: repeated private-directory ACL protection requires SeSecurityPrivilege

1 participant