Connecting to remote machines over SSH fails if there is LocalForward specified
Open 💬 0 comments Opened Jun 3, 2026 by mkonecny-atlassian
What version of the Codex App are you using (From “About Codex” dialog)?
26.601.21317
What subscription do you have?
Enterprise
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
When setting up a connection to a remote machine over SSH (Settings → Connections) the process fails at the authentication step with:
<img width="942" height="892" alt="Image" src="https://github.com/user-attachments/assets/d552ea94-55fb-4582-af71-edebc814d7ea" />
Codex passes -o ExitOnForwardFailure=yes in SSH and this fails if there is already an SSH client connected to that remote.
What steps can reproduce the bug?
- SSH configuration for a host in
~/.ssh/my_host_configcontainsLocalForward 8080 localhost:8080(or any other port forward) - Connect in terminal with to the above host (so that the port-forwarding is established)
- Now try to add the connection in Codex. Establishing connection seems to work but once you try to log-in, the process tries again to establish the SSH port forwarding, which fails.
I believe that -o ExitOnForwardFailure is set to yes in Codex.
What is the expected behavior?
It would be possible to authenticate and use the remote even if LocalForward is used
Additional information
_No response_