SSH remote connection fails with "socket hang up" on Cloudways despite successful SSH and working codex-cli
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.707.51957
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
When attempting to connect to a remote server using the ChatGPT Desktop app's SSH connection feature, the connection consistently fails with:
socket hang up
The remote server is accessible over SSH, and the Codex CLI is installed and executable.
The issue appears to occur during the desktop app's remote connection/bootstrap process rather than during SSH authentication itself.
No additional diagnostic information is shown in the application, making it difficult to determine the underlying cause.
What steps can reproduce the bug?
- Install the latest Codex CLI on a remote Cloudways server.
- Verify that SSH key authentication works.
- Verify that the Codex CLI is installed:
/home/master/codex --version
This returns:
codex-cli 0.144.5
- In ChatGPT Desktop, go to:
Settings → Connections → SSH
- Create a new SSH connection using:
- Hostname: user@host
- Identity file: ~/.ssh/id_ed25519
- Save the connection and attempt to connect.
- The connection immediately fails with:
socket hang up
Additional observations:
- Interactive SSH sessions work normally.
- Running
/home/master/codex --versionover SSH succeeds. - Running
codex --versionover SSH fails because the remote environment does not expose the Codex executable on PATH during non-interactive SSH sessions.
What is the expected behavior?
The desktop app should establish a remote Codex session successfully when the remote Codex CLI is installed and executable.
If the connection cannot be established because the executable cannot be located, the app should report the underlying bootstrap or SSH error rather than only displaying:
socket hang up
Ideally the app would also:
- allow specifying the full path to the remote
codexexecutable, - search common installation locations when
codexis not found on PATH, or - include the failed remote command and exit status in the error message to simplify troubleshooting.
Additional information
We spent approximately an hour isolating this issue before opening this report.
The following were verified during troubleshooting:
- SSH key authentication works.
- Interactive SSH sessions work normally.
- Non-interactive SSH sessions work normally.
- The remote Codex CLI is installed correctly.
/home/master/codex --versionsucceeds locally and over SSH.codex --versionfails only because the remote environment does not expose the Codex executable on PATH for non-interactive SSH commands.- The desktop app consistently reports only
socket hang upwith no additional diagnostic information.
We intentionally avoided making further changes to the server once it became clear the issue was likely occurring during the desktop app's remote bootstrap process.
If additional logging or a debug build would help, I'd be happy to test it and provide results.