Skip to content

[v3-3-test] Stop Breeze container SSH setup from modifying the host ~/.ssh (#72182) - #72191

Merged
potiuk merged 1 commit into
v3-3-testfrom
backport-51ebe32-v3-3-test
Aug 28, 2026
Merged

[v3-3-test] Stop Breeze container SSH setup from modifying the host ~/.ssh (#72182)#72191
potiuk merged 1 commit into
v3-3-testfrom
backport-51ebe32-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

When Breeze runs with --forward-credentials, the host's ~/.ssh is
bind-mounted read-write at /root/.ssh and the container start used to
operate on it directly. Every start overwrote the user's id_rsa with a
throwaway key, appended that key to authorized_keys and three localhost
entries to known_hosts (observed to accumulate hundreds of entries), left
a dangling authorized_keys2 symlink, and ran 'chmod 600 ~/.ssh/*'. That
chmod also strips the execute bit from the ~/.ssh/agent directory that
OpenSSH 10.x uses for agent sockets. On macOS this kills the
launchd-managed ssh-agent and, after the next reboot, makes every ssh on
the host hang waiting on the dead agent socket.

The ssh-to-localhost setup, which the real-connection SSH and SFTP
provider tests rely on, now lives entirely in /root/.breeze-ssh, a path
that is never mounted from the host. sshd accepts the generated key via
an sshd_config.d drop-in, the OpenSSH client finds it via an ssh_config.d
drop-in, and paramiko-based hooks, which read neither, discover it
through an ssh-agent started by the entrypoint. entrypoint_exec.sh
exports the agent socket so 'breeze exec' shells get it too. The
authorized_keys2 symlink had no consumers anywhere in the repo and is
dropped.
(cherry picked from commit 51ebe32)

Co-authored-by: Ramit Kataria hi@ramit.ca

…/.ssh (#72182)

When Breeze runs with --forward-credentials, the host's ~/.ssh is
bind-mounted read-write at /root/.ssh and the container start used to
operate on it directly. Every start overwrote the user's id_rsa with a
throwaway key, appended that key to authorized_keys and three localhost
entries to known_hosts (observed to accumulate hundreds of entries), left
a dangling authorized_keys2 symlink, and ran 'chmod 600 ~/.ssh/*'. That
chmod also strips the execute bit from the ~/.ssh/agent directory that
OpenSSH 10.x uses for agent sockets. On macOS this kills the
launchd-managed ssh-agent and, after the next reboot, makes every ssh on
the host hang waiting on the dead agent socket.

The ssh-to-localhost setup, which the real-connection SSH and SFTP
provider tests rely on, now lives entirely in /root/.breeze-ssh, a path
that is never mounted from the host. sshd accepts the generated key via
an sshd_config.d drop-in, the OpenSSH client finds it via an ssh_config.d
drop-in, and paramiko-based hooks, which read neither, discover it
through an ssh-agent started by the entrypoint. entrypoint_exec.sh
exports the agent socket so 'breeze exec' shells get it too. The
authorized_keys2 symlink had no consumers anywhere in the repo and is
dropped.
(cherry picked from commit 51ebe32)

Co-authored-by: Ramit Kataria <hi@ramit.ca>
@potiuk
potiuk marked this pull request as ready for review August 28, 2026 13:23
@potiuk
potiuk merged commit 7d1a1ce into v3-3-test Aug 28, 2026
3 of 4 checks passed
@potiuk
potiuk deleted the backport-51ebe32-v3-3-test branch August 28, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants