Skip to content

Experimental ssh: Enable scp/rsync/sftp support for ssh connect#5000

Open
anton-107 wants to merge 2 commits intomainfrom
anekipelov/ssh-connect-scp-support
Open

Experimental ssh: Enable scp/rsync/sftp support for ssh connect#5000
anton-107 wants to merge 2 commits intomainfrom
anekipelov/ssh-connect-scp-support

Conversation

@anton-107
Copy link
Copy Markdown
Contributor

Summary

  • ssh connect now auto-writes an SSH config entry so that scp, rsync, and sftp work with the same hostname (opt out with --no-config)
  • Add --multiplex flag to both connect and setup for SSH ControlMaster connection reuse during active sessions
  • Suppress all cmdio output in proxy mode — fixes "Uploading binaries..." noise when tools like scp invoke the ProxyCommand
  • Handle context.Canceled gracefully in proxy mode — fixes "Error: context canceled" message when scp/rsync disconnect
  • Stop embedding stale server metadata in the persisted SSH config (IDE mode), making the config resilient to server restarts
  • Refactor GenerateHostConfig to use a HostConfigOptions struct for extensibility

Test plan

  • databricks ssh connect prints SSH tool usage hints and writes config
  • scp <hostname>:remote-file local-file works while session is active
  • No "Uploading binaries..." or "Error: context canceled" noise from ProxyCommand
  • databricks ssh connect --no-config skips config writing
  • databricks ssh connect --multiplex adds ControlMaster to config and inline args
  • databricks ssh setup --name=my-host --cluster=<id> --multiplex includes ControlMaster
  • cat ~/.databricks/ssh-tunnel-configs/<hostname> shows correct config
  • Unit tests pass: go test ./experimental/ssh/...

This pull request was AI-assisted by Isaac.

The `ssh connect` command now automatically writes an SSH config entry
so that standard SSH tools can connect using the same hostname. This
also suppresses noisy output in proxy mode and handles context
cancellation gracefully when tools like scp disconnect.

- Auto-write SSH config from `connect` (opt out with `--no-config`)
- Add `--multiplex` flag for SSH ControlMaster connection reuse
- Suppress cmdio output in proxy mode (fixes "Uploading binaries..." noise)
- Return nil for context.Canceled in proxy mode (fixes "Error: context canceled")
- Remove stale metadata from persisted SSH config (IDE mode fix)
- Refactor GenerateHostConfig to use HostConfigOptions struct

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

Waiting for approval

Based on git history, these people are best suited to review:

  • @ilia-db -- recent work in experimental/ssh/internal/client/, experimental/ssh/cmd/, experimental/ssh/internal/setup/

Eligible reviewers: @andrewnester, @denik, @pietern, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

@anton-107 anton-107 changed the title Enable scp/rsync/sftp support for ssh connect Experimental ssh: Enable scp/rsync/sftp support for ssh connect Apr 16, 2026
@anton-107 anton-107 requested a review from ilia-db April 16, 2026 16:11
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.

1 participant