Skip to content

Windows ssh 9.5.5.1 doesn't like CodexSandboxUsers on ~/.ssh/id_rsa #12226

Open

Description

@HenkPoley

What version of Codex CLI is running?

0.99.0 and later on 0.104.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal

What issue are you seeing?

C:\User\user> ssh -V
OpenSSH_for_Windows_9.5p2, LibreSSL 3.8.2
C:\Users\user> ssh example.com
Bad permissions. Try removing permissions for user: <Hostname>\\CodexSandboxUsers (S-1-5-21-<Windows Security Identifier>) on file C:/Users/user/.ssh/id_rsa.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\\Users\\user/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\\Users\\user/.ssh/id_rsa": bad permissions

I did some icacls shenanigans to set permissions back to something SSH is happy with.

I also updated codex with npm i -g @openai/codex. Now codex is borked on some starlark rule (deleted this rule from default.rules and it works again):

C:\User\user> codex --version
codex-cli 0.104.0
C:\User\user> codex --full-auto resume 019c322b-<UUID>-c62f430b46ce
Error loading rules:
C:\Users\user\.codex\rules\default.rules:38: starlark error: error: Parse error: unexpected identifier 'HOME' here, expected one of "\n", "!=", "%", "%=", "&", "&=", "(", ")", "*", "*=", "+", "+=", ",", "-", "-=", ".", "/", "//", "//=", "/=", ":", ";", "<", "<<", "<<=", "<=", "=", "==", ">", ">=", ">>", ">>=", "[", "]", "^", "^=", "and", "else", "for", "if", "in", "not", "or", "|", "|=" or "}" (problem is on or around line 38)

What steps can reproduce the bug?

I guess:

  1. Use the OpenAI Codex CLI with Windows sandbox (--full-auto ?).
  2. It sets up some extra user.
  3. SSH freaks out.

What is the expected behavior?

Find a way to sandbox that does not freak out Windows's ssh.

Additional information

The issue did not re-appear immediately when I did a codex --full-auto resume <UUID> with OpenAI Codex CLI (v0.104.0)

Activity

  1. added
    bug
    on Feb 19, 2026
  2. added
    CLI
    windows-os
    sandbox
    on Feb 19, 2026
  3. removed
    CLI
    on Feb 19, 2026
  4. Timtam commented on Feb 26, 2026

    @Timtam

    Same issue here. I was also confused about the entire sandbox thing not working at all, as in, codex always gets "no output". I then resorted to removing the user permissions from my entire C:\Usersẞ<Username> folder as .ssh was inheriting the ones from said folder. Now ssh is back and working again, however codex still gives me no output and can't work at all as it seems. It basically broke my codex :).

  5. rayjasson98 commented on Feb 27, 2026

    @rayjasson98

    Same issue. I’ve always used Codex in WSL, but I tried running it on native Windows and it ended up messing up my SSH config. I won’t be using Codex on Windows again. :(

  6. added a commit that references this issue on Feb 27, 2026
  7. itchenfei commented on Mar 3, 2026

    @itchenfei

    same issue here

  8. tzarebczan commented on Mar 6, 2026

    @tzarebczan

    Just ran into this as well. What's worse, if you use git bash, it fails silently.

  9. l0wdin commented on Mar 18, 2026

    @l0wdin

    Same thing happened here.
    I had to disable inheritance on these files and remove CodexSandboxUsers (in my case, I also had to remove another SID starting with S-1-5-21..., but I couldn’t link that user to Codex itself):

    %userprofile%/.ssh/config
    %userprofile%/some_path_here/ssh.key

    Just ran into this as well. What's worse, if you use git bash, it fails silently.

    I figured out this was the problem because I was trying to use Remote Explorer in VS Code to connect to a remote Linux server. It fails silently there too.

  10. hczs commented on Apr 7, 2026

    @hczs

    Fuck CODEX!

  11. JakeyPrime commented on Apr 16, 2026

    @JakeyPrime

    Also having this issue, even with Codex completely uninstalled.

  12. linQian99 commented on Apr 17, 2026

    @linQian99

    TOO RIDICULOUS. This make me even could not ssh, how could theses guys even not test such a simple function????

  13. alexkras commented on Apr 20, 2026

    @alexkras

    it doesn't work with windows native command line (powershell, terminal) - it show error:
    Bad permissions. Try removing permissions for user: ... CodexSandboxUsers ...
    at the same time minegw64 (in git-bash particular) works well, looks like it's ignore Win UAC.

  14. HenkPoley commented on Sep 28, 2026

    @HenkPoley
    Author
  15. xoloyinks commented on Oct 15, 2026

    @xoloyinks

    This worked for me: $key = pem file directory
    $user = [System.Security.Principal.WindowsIdentity]::GetCurrent().User

    $acl = New-Object System.Security.AccessControl.FileSecurity
    $acl.SetOwner($user)
    $acl.SetAccessRuleProtection($true, $false)

    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
    $user,
    "Read",
    "Allow"
    )
    $acl.AddAccessRule($rule)

    Set-Acl -LiteralPath $key -AclObject $acl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions