Git push --dry-run fails with Bad owner or permissions on /etc/ssh/ssh_config.d/... (SSH config owned by nobody inside sandbox)
What version of Codex is running?
codex-cli 0.84.0
What subscription do you have?
Pro
Which model were you using?
5.2-high (happens on all)
What platform is your computer?
Linux 6.18.3-arch1-1 x86_64
What terminal emulator and version are you using (if applicable)?
Ghostty
What issue are you seeing?
Trying to do a git push dry run from within Codex fails before auth/networking, because OpenSSH refuses to read system SSH config due to ownership/permissions.
Command:
git push --dry-run
Output:
Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Also reproducible directly via ssh config parsing:
ssh -G github.com
Output:
Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf
Key observation: inside this Codex environment, /etc/ssh and its config files are owned by nobody (uid 65534), which triggers OpenSSH’s safety checks.
Evidence:
whoami && id
root
uid=0(root) gid=0(root) groups=0(root),65534(nobody)
ls -ld /etc/ssh /etc/ssh/ssh_config.d
drwxr-xr-x 1 nobody nobody 344 Nov 27 19:09 /etc/ssh
drwxr-xr-x 1 nobody nobody 50 Jan 9 11:42 /etc/ssh/ssh_config.d
ls -l /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf
lrwxrwxrwx 1 nobody nobody 63 Jan 6 18:29 /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf -> ../../../usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
ls -l /usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
-rw-r--r-- 1 nobody nobody 807 Jan 6 18:29 /usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
What steps can reproduce the bug?
- Start Codex CLI session in a git repo with an SSH remote (example above).
- Run git push --dry-run.
- Observe failure: Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf.
- Confirm /etc/ssh and /usr/lib/systemd/ssh_config.d/... are owned by nobody inside the Codex environment (commands above).
Notes:
- This appears to be an environment/sandbox regression: OpenSSH rejects system config because it is not owned by root (even though the process user is root).
- In the same session, codex --version prints a PATH-update warning (permission denied) which may be related.
What is the expected behavior?
- git push --dry-run should either:
- proceed to network/auth and succeed, or
- fail with an expected SSH auth error (e.g., missing key), or
- fail with a normal git remote/access error,
- but not fail immediately due to broken ownership of system SSH config files inside the Codex environment. Previous version worked perfectly.
Additional information
Codex sandbox/config observed in this session (from harness):
- sandbox_mode: workspace-write
- approval_policy: on-failure
- Network access: enabled
Tool versions:
- git --version: git version 2.52.0
- ssh -V: OpenSSH_10.2p1, OpenSSL 3.6.0 1 Oct 2025
5 Comments
As an additional data point, the Cursor IDE (no Codex involved) issues the exact same
Bad owner or permissions on /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conferror. The commonality is that this is an Arch Linux system too.I don't know if Cursor and Codex are using the same underlying sandbox library or sandbox approach that's missing special case handling for permissions checks in recent OpenSSH versions or something else entirely.
As a workaround, I've found that scp/ssh
-F /dev/nullavoids the system config file and things work, at least in Cursor but will probably work in Codex too.If the ssh_config.d contains real configuration, then the only workaround is to completely switch off the sandbox.
Otherwise codex cannot use ssh.
The bug here is that the sandbox arbitrarily shows different file owner and file group, for no useful reason. At least I do not know of any valid reason.
As chatgpt recommends: Please add a "please_do_not_lie_about_ssh_config_ownership" flag to the configuration.
Still reproducible with:
The failure occurs before authentication or networking:
RPM metadata says the affected OpenSSH files should be
root:root, but inside the Codex Bubblewrap sandbox they appear asnobody:nobody:This is not isolated to that file: other package-owned system files and executables also appear as
nobody:nobodyin the sandbox.Control test:
That confirms workspace Git metadata is writable and network/SSH-agent access works. However,
-F /dev/nullis not an acceptable general workaround here because the system SSH configuration contains IPA known-host handling and the Red Hat system crypto policy.I also tested the documented legacy Landlock fallback with this managed permission profile. Codex aborts with:
So neither the empty-config workaround nor Landlock is viable for an enterprise-managed environment.
It would be helpful if the Bubblewrap sandbox preserved trustworthy ownership for the read-only system tree, or otherwise supported OpenSSH system
Includefiles. Acodex doctorcheck for this condition would also make the failure much easier to diagnose.Still reproducible on a current Arch Linux setup:
workspace-writepermission profile with a restricted filesystemThe affected systemd-provided SSH include is correctly owned on the host:
Every parent directory is also root-owned and not group/world-writable. In host context, the normal configuration parses and the configured host alias works:
Inside the Codex sandbox, the same symlink, target, and all parent path components are exposed as UID/GID 65534 (
nobody:nobody):This confirms the failure is caused solely by the sandbox ownership remapping of a trustworthy read-only system tree; the host permissions are valid.
Using
ssh -F noneavoids the ownership check, but is not an equivalent workaround: it also discards the legitimate system/user SSH configuration, including themediaserverhost alias, so the hostname then fails to resolve.Additional Linux / user SSH-config data point
This also affects a user-level
~/.ssh/config, not only/etc/sshincludes. The host configuration is valid; the failure is introduced by the sandbox view of that file.Environment
0.147.026.11.20260802.6438090Linux 7.1.5 x86_64OpenSSH_10.3p12.54.0~/.ssh/configis Home Manager-managed and resolves into the Nix store. That is safe on the host and normal OpenSSH configuration parsing succeeds.Host control
Inside the Codex sandbox
The file remains read-only, but its owner/group are remapped from
root:roottonobody:nogroup. OpenSSH rejects that metadata before authentication or network access. The same SSH/Git operation succeeds when Git runs outside the Codex sandbox, which isolates the failure to sandbox mount/identity presentation.Expected behavior
A trusted host SSH configuration exposed read-only inside the sandbox should retain OpenSSH-safe ownership metadata. This is not a request to weaken OpenSSH checks, disable commit signing, or broaden filesystem access.
ssh -F /dev/nullcan mask the symptom, but it is not an adequate workaround: it discards legitimate user SSH configuration, host aliases, signing settings, policy includes, and known-host behavior. This appears to be the same underlying metadata-preservation class as the system-config failure in this issue.