codex - 💡(How to fix) Fix Codex Remote SSH fails if RemoteCommand field included in SSH config [1 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#18322Fetched 2026-04-18 05:56:01
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

Error Message

Error

Code Example

Host my-host
  RemoteCommand sudo -iu user

---

Error
Cannot execute command-line and remote command.
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.415.21839 (1763)

What subscription do you have?

Business

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

~/.ssh/config:

Host my-host
  RemoteCommand sudo -iu user

In Codex app Settings->Connections, the status of the my-host entry is:

Error
Cannot execute command-line and remote command.

What steps can reproduce the bug?

Include RemoteCommand in a config block in ~/.ssh/config. In my case, I am trying to switch user, but the failure mode can be reproduced with any command. For example, RemoteCommand echo "test" still fails.

What is the expected behavior?

Connection succeeds.

Additional information

No response

extent analysis

TL;DR

The issue is likely due to the Codex App not supporting the RemoteCommand directive in the ~/.ssh/config file, and a workaround may be to remove or modify this directive.

Guidance

  • Verify that the RemoteCommand directive is the cause of the issue by temporarily removing it from the ~/.ssh/config file and checking if the connection succeeds.
  • Check the Codex App documentation to see if there are any known limitations or workarounds for using RemoteCommand with the app.
  • Consider using an alternative method to switch users, such as using a separate SSH connection or a different configuration option.
  • If the issue persists, try using a different SSH client to see if the problem is specific to the Codex App.

Example

No code snippet is provided as the issue is related to configuration and not code.

Notes

The issue may be specific to the version of the Codex App being used (26.415.21839), and upgrading to a newer version may resolve the issue. However, without further information, it is unclear if this is the case.

Recommendation

Apply workaround: Remove or modify the RemoteCommand directive in the ~/.ssh/config file, as it is likely not supported by the Codex App.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING