Skip to content

Mask system SSH config drop-ins in the Linux sandbox - #61947

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/e8d9cd7a4bd29480d1b930efc96510362a88d3fc
Nov 17, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/e8d9cd7a4bd29480d1b930efc96510362a88d3fc

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Mask system SSH config drop-ins in the Linux sandbox

Why

Host root-owned SSH config drop-ins can appear to belong to nobody inside the user namespace, causing OpenSSH to reject them and preventing SSH connections.

What changed

Mask /etc/ssh/ssh_config.d with an empty, read-only directory by default for filesystem-restricted commands. Preserve explicit read grants to drop-ins and overlapping write grants, and avoid masking through symlinks or unsafe ancestor directories.

The main /etc/ssh/ssh_config and user configuration still apply. Settings in masked drop-ins, including KnownHostsCommand, are skipped.

Testing

Add an isolated SSH handshake regression test that verifies a connection succeeds with system drop-ins masked and that a changed host key is still rejected.

## Why

Host root-owned SSH config drop-ins can appear to belong to `nobody` inside the user namespace, causing OpenSSH to reject them and preventing SSH connections.

## What changed

Mask `/etc/ssh/ssh_config.d` with an empty, read-only directory by default for filesystem-restricted commands. Preserve explicit read grants to drop-ins and overlapping write grants, and avoid masking through symlinks or unsafe ancestor directories.

The main `/etc/ssh/ssh_config` and user configuration still apply. Settings in masked drop-ins, including `KnownHostsCommand`, are skipped.

## Testing

Add an isolated SSH handshake regression test that verifies a connection succeeds with system drop-ins masked and that a changed host key is still rejected.

GitOrigin-RevId: e8d9cd7a4bd29480d1b930efc96510362a88d3fc
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/e8d9cd7a4bd29480d1b930efc96510362a88d3fc branch from c118b9d to ad16120 Compare November 17, 2026 02:33
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-17T02:33:14.905938Z c118b9d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit ad16120 into main Nov 17, 2026
9 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/e8d9cd7a4bd29480d1b930efc96510362a88d3fc branch November 17, 2026 02:33
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 17, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — ad161203 Deployed Nov 17, 2026 by zakusilo-create via Generate label suggestions #63897
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants