Repository navigation
Codex Desktop Windows-to-Windows Remote SSH fails after authentication because bootstrap requires POSIX sh #26164
Description
What version of the Codex App are you using (From “About Codex” dialog)?
v0.136.0
What subscription do you have?
ChatGPT Pro
What platform is your computer?
The code you guys are giving is not working btw:
$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }) ParserError: Line | 1 | $([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Env … | ~~ | Unexpected token '$(' in expression or statement. -----
Windows 11 25h2 BTW
What issue are you seeing?
Codex Desktop Remote SSH authenticates successfully to a native Windows OpenSSH host, but the connection fails during remote bootstrap.
SSH key authentication works correctly. Manual SSH login succeeds without a password. Codex discovers the host, authenticates, and begins remote setup.
However, the remote bootstrap appears to execute POSIX shell syntax on the Windows host's default shell. The connection then fails with errors similar to:
-sh: -c: line 2: syntax error:
unexpected end of file from `if` command
Earlier connection attempts also showed errors consistent with POSIX shell code being interpreted by Windows shells.
Environment
Local machine:
- Windows
- Codex Desktop
- OpenSSH_for_Windows_9.5p2
Remote machine:
- Windows 11
- Native Windows OpenSSH Server
- User:
ct4nk3r - Public key authentication configured and working
What steps can reproduce the bug?
- Configure a Windows machine running OpenSSH Server.
- Configure SSH key authentication.
- Verify normal SSH works:
ssh -i C:\Users\MBosze\.ssh\codex_ed25519 ct4nk3r@100.121.5.113
ssh ct4nk3r@<host>
- Verify SSH key authentication works:
ssh -i <private-key> ct4nk3r@<host>
- Add the host in Codex Desktop Remote Connections.
- Enable the connection.
- Observe that authentication succeeds but the connection fails during bootstrap.
What is the expected behavior?
Codex Desktop should either:
- support native Windows OpenSSH hosts using PowerShell/cmd,
- automatically detect and use an appropriate Windows bootstrap path,
- or display a clear message that only POSIX-compatible shells (WSL, Linux, Git Bash, etc.) are supported.
Additional information
The issue does not appear to be related to SSH configuration.
I verified:
- SSH connectivity works.
- Public key authentication works.
- Codex uses the correct key.
- Codex reaches the remote machine.
The failure occurs only after authentication when the remote bootstrap is executed.
This appears similar to other reports where Codex Remote SSH assumes a POSIX shell environment on Windows hosts.
What steps can reproduce the bug?
Create a public key for ssh connection.
Create an identity file.
SSH to the other windows machine -> works without a password now.
Add that identity file to codex's ssh connection's identity profile.
Connection is not working. It is trying to use Linux native commands on the windows host.
Additional information
Manual SSH authentication succeeds using the same host, user, and private key that are configured in Codex Desktop.
It works with phone. And it works if the host is a linux machine.
The first time this problem happened is now, when I tried to connect two windows machines.
I also tested the same Codex Desktop client and same SSH key against a Linux host.
Result:
- Windows 11 OpenSSH host: SSH authentication succeeds, but Codex bootstrap fails with shell syntax error.
- CachyOS Linux OpenSSH host: SSH authentication succeeds and Codex connects successfully.
This suggests the issue is specific to native Windows OpenSSH remote hosts, not my SSH key, network, or Codex client configuration.
Connection to my home server works correctly (It's running CachyOS):


Activity
[-]Windows <-> Windows ssh connection for remote codex usage[/-][+]Codex Desktop Windows-to-Windows Remote SSH fails after authentication because bootstrap requires POSIX sh[/+]AemonYwj commentedon Jul 21, 2026
I can reproduce the same issue when connecting from the macOS ChatGPT/Codex desktop app to a native Windows OpenSSH host, so this is not limited to Windows-to-Windows connections.
Environment
Local client:
0.145.0Remote host:
10.0.26200OpenSSH_for_Windows_9.5cmd.execodex-cli 0.136.0codex,codex remote-control, andcodex app-serverare available on PATHVerification
Normal SSH works correctly with the same host alias, user, key, and host key:
Codex Desktop also successfully authenticates:
The failure happens afterward during
remote_codex_lookup. The desktop app sends a POSIX bootstrap command beginning with:sh -c 'if [ -z "$SHELL" ] || [ ! -x "$SHELL" ]; then ...'Because Windows OpenSSH passes this to
cmd.exe, it fails with errors including:The application log identifies the failed stage as:
I reproduced the same bootstrap failure over both a direct LAN address and a Tailscale address. Therefore, this is independent of the underlying transport, VPN/TUN configuration, host-key verification, and SSH authentication.
This confirms that the current remote bootstrap assumes a POSIX-compatible login shell even when the remote server reports
OpenSSH_for_Windows.Expected behavior would be one of:
This also appears related to #29015.
mmiladinov commentedon Jul 24, 2026
+1
SunHuilong commentedon Aug 16, 2026
Still reproducible after updating Codex on 2026-08-16. The remote Codex CLI was updated from 0.144.1 to 0.147.0, but the behavior is unchanged.
Current environment
Reproduction result
Manual SSH with the same host and key works, and the remote CLI is available:
Codex Desktop also completes public-key authentication:
It then fails during remote_codex_lookup:
Assessment
The native Windows OpenSSH server passes remote commands to cmd.exe. Codex Desktop invokes sh -c before its later uname -s platform detection, so the Windows detection path is never reached.
This means the failure occurs after SSH authentication and before the remote Codex app-server can be started.
Expected behavior
Codex Desktop should either:
saayeeem commentedon Oct 5, 2026
Additional Windows desktop log evidence from 2026-10-05 UTC:
'sh' is not recognized as an internal or external commandand'[' is not recognized as an internal or external command.state=error; this signature recurred in separate log sessions, including 19:35 UTC and 20:30–20:41 UTC.This is a further reproduction of the post-authentication bootstrap failure described here. The private host address and account identifiers are omitted; this evidence does not establish a different root cause.
saayeeem commentedon Oct 6, 2026
Additional Windows desktop log evidence from 2026-10-06 UTC (2026-10-07 in Asia/Dhaka):
OpenSSH_for_Windows 9.5p1host.'sh' is not recognized as an internal or external commandand'[' is not recognized as an internal or external command.26.930.7945.0.This reproduces the post-authentication bootstrap failure in this report. Private host addresses and account identifiers are omitted.