codex - 💡(How to fix) Fix Remote SSH connection fails when remote login shell is csh/tcsh [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19302Fetched 2026-04-24 10:38:57
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×4commented ×2mentioned ×1subscribed ×1

Root Cause

Normal SSH to the host succeeds, passwordless auth works, and the remote has both /bin/bash and /bin/sh installed. The remote codex app-server --help command also works when run manually. The failure appears to happen because the Desktop remote bootstrap is executed through the remote login shell and uses Bourne/bash-style syntax or -l flags that csh does not accept.

Code Example

[remote-connections/discovery] discovery_completed collectedAliasCount=1 ... resolvedConnectionCount=1
[WindowContext] [ssh-websocket-v0] selected app-server transport websocketUrl=ws://127.0.0.1:<local-port>/rpc
[AppServerTransportSshWebsocket] ssh_websocket_v0.ensure_remote_app_server_and_tunnel localPort=<local-port> remotePort=<remote-port> sshAlias=<redacted> sshHost=<redacted> sshPort=<redacted>
[AppServerConnection] app_server_connection.transport_connect_failed
errorMessage="Unmatched '''.
fi: Command not found.
Unknown option: `-l'
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ]."
RAW_BUFFERClick to expand / collapse

What happened?

Codex Desktop Remote Connections can discover an SSH host from ~/.ssh/config, but enabling the connection fails during remote app-server bootstrap when the remote account's login shell is /bin/csh.

Normal SSH to the host succeeds, passwordless auth works, and the remote has both /bin/bash and /bin/sh installed. The remote codex app-server --help command also works when run manually. The failure appears to happen because the Desktop remote bootstrap is executed through the remote login shell and uses Bourne/bash-style syntax or -l flags that csh does not accept.

Sanitized log excerpt

[remote-connections/discovery] discovery_completed collectedAliasCount=1 ... resolvedConnectionCount=1
[WindowContext] [ssh-websocket-v0] selected app-server transport websocketUrl=ws://127.0.0.1:<local-port>/rpc
[AppServerTransportSshWebsocket] ssh_websocket_v0.ensure_remote_app_server_and_tunnel localPort=<local-port> remotePort=<remote-port> sshAlias=<redacted> sshHost=<redacted> sshPort=<redacted>
[AppServerConnection] app_server_connection.transport_connect_failed
errorMessage="Unmatched '''.
fi: Command not found.
Unknown option: `-l'
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ]."

Environment

  • Codex Desktop on Windows
  • Codex app version observed in local install/logs: 26.422.2437.0
  • Remote app-server version reported by logs: 0.124.0-alpha.2
  • Remote host: Unix/Linux via SSH
  • Remote login shell: /bin/csh
  • /bin/bash and /bin/sh are available on the remote
  • SSH auth works normally outside Codex Desktop
  • Host alias, hostname, user, and ports intentionally redacted

Expected behavior

Codex Desktop Remote Connections should either:

  1. bootstrap through a POSIX shell explicitly, e.g. /bin/sh -lc ..., regardless of the account login shell;
  2. support csh/tcsh login shells with compatible syntax; or
  3. expose a per-connection "remote bootstrap shell" setting, e.g. /bin/bash, so users can keep their login shell as csh for existing remote workflows.

Why changing the login shell is not always viable

Some enterprise environments require csh/tcsh login shells for existing tool setup. In this environment the shell is managed by central account tooling and cannot be changed locally. Users may need to keep csh as the login shell while allowing Codex to use sh/bash only for its bootstrap.

extent analysis

TL;DR

The most likely fix is to modify the remote connection setup to use a POSIX shell explicitly, such as /bin/sh, for bootstrapping the Codex app-server.

Guidance

  • Verify that the remote host has /bin/sh installed and accessible, as it is required for the workaround.
  • Consider setting up an alias or a wrapper script on the remote host to invoke the Codex app-server with the correct shell, e.g., /bin/sh -lc "codex app-server --help".
  • If possible, test changing the remote login shell to /bin/bash temporarily to confirm that the issue is indeed related to the shell compatibility.
  • Explore the possibility of configuring Codex Desktop to use a specific shell for remote connections, such as adding a "remote bootstrap shell" setting.

Example

# Example wrapper script to invoke Codex app-server with /bin/sh
#!/bin/sh
/bin/sh -lc "codex app-server $@"

Notes

The provided solution assumes that the remote host has /bin/sh installed and accessible. If this is not the case, alternative solutions may need to be explored. Additionally, the wrapper script example is a simplified demonstration and may require modifications to work with the specific Codex app-server command.

Recommendation

Apply workaround: Modify the remote connection setup to use a POSIX shell explicitly, such as /bin/sh, for bootstrapping the Codex app-server. This approach allows users to keep their login shell as csh while enabling Codex to use a compatible shell for its bootstrap process.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Codex Desktop Remote Connections should either:

  1. bootstrap through a POSIX shell explicitly, e.g. /bin/sh -lc ..., regardless of the account login shell;
  2. support csh/tcsh login shells with compatible syntax; or
  3. expose a per-connection "remote bootstrap shell" setting, e.g. /bin/bash, so users can keep their login shell as csh for existing remote workflows.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Remote SSH connection fails when remote login shell is csh/tcsh [2 comments, 2 participants]