Repository navigation
Open
Labels
bugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems
Description
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 permissionsI 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:
- Use the OpenAI Codex CLI with Windows sandbox (
--full-auto?). - It sets up some extra user.
- 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)
Reacted by jingkaihusc, pho, Manuel Jiménez Torres, Meir Blumenfeld, Ray Jasson, master20151121, 项科深 Xiang Keshen, Stephen Halter, Tobias Messner, Ivan Sowerby and 9 more
Reacted by Manuel Jiménez Torres, Ray Jasson and Ivan Sowerby
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems
Activity
Timtam commentedon Feb 26, 2026
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 :).
don't grant sandbox read access to ~/.ssh and a few other dirs. (#12835)
rayjasson98 commentedon Feb 27, 2026
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. :(
[pull] main from openai:main (#12)
sync: full upstream codex refresh (stabilized) (#317)
itchenfei commentedon Mar 3, 2026
same issue here
tzarebczan commentedon Mar 6, 2026
Just ran into this as well. What's worse, if you use git bash, it fails silently.
l0wdin commentedon Mar 18, 2026
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 withS-1-5-21..., but I couldn’t link that user to Codex itself):%userprofile%/.ssh/config
%userprofile%/some_path_here/ssh.key
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.
hczs commentedon Apr 7, 2026
Fuck CODEX!
JakeyPrime commentedon Apr 16, 2026
Also having this issue, even with Codex completely uninstalled.
linQian99 commentedon Apr 17, 2026
TOO RIDICULOUS. This make me even could not ssh, how could theses guys even not test such a simple function????
alexkras commentedon Apr 20, 2026
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.
don't grant sandbox read access to ~/.ssh and a few other dirs. (#12835)
don't grant sandbox read access to ~/.ssh and a few other dirs. (open…
don't grant sandbox read access to ~/.ssh and a few other dirs. (#12835)
HenkPoley commentedon Sep 28, 2026
xoloyinks commentedon Oct 15, 2026
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