[v3-3-test] Stop Breeze container SSH setup from modifying the host ~/.ssh (#72182) - #72191
Merged
Conversation
…/.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>
1 task
potiuk
marked this pull request as ready for review
August 28, 2026 13:23
potiuk
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
August 28, 2026 13:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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