Skip to content

Add --ssh-jump CLI argument#1986

Open
rolandwalker wants to merge 1 commit into
mainfrom
RW/ssh-jump-restore
Open

Add --ssh-jump CLI argument#1986
rolandwalker wants to merge 1 commit into
mainfrom
RW/ssh-jump-restore

Conversation

@rolandwalker

@rolandwalker rolandwalker commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Description

Add --ssh-jump CLI argument, restoring functionality removed in v2.0.0, under a different interface, and with a different internal implementation.

In the new interface, there is a single argument --ssh-jump, which accepts values in the form user@host:port. Cleartext SSH passwords on the CLI are no longer accepted. The user will be prompted for a password if the connection is not otherwise configured.

Deprecated arguments such as --ssh-host now refer to --ssh-jump.

Remote sockets are accepted. The user should give the MySQL endpoint exactly as it would be accepted from the jump host.

A keyring field is added for the ssh-jump value, if any, but the field is not appended unless present, so existing keyring values are not invalidated.

The internals of the new implementation are completely different: instead of using complex Python libraries (paramiko/sshtunnel) we simply open a tunnel using the ssh executable in a thread. This is more robust in a few ways: paramiko for example is not capable of reading nontrivial SSH config files.

A new [ssh] section is added to myclirc with some recommended CLI arguments to SSH when establishing tunnels.

Fixes #1960.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Jul 4, 2026
@rolandwalker rolandwalker requested review from amjith and scottnemes July 4, 2026 17:10
@rolandwalker rolandwalker force-pushed the RW/ssh-jump-restore branch 3 times, most recently from 213d8d3 to 864159d Compare July 6, 2026 10:20
restoring functionality removed in v2.0.0, under a different interface,
and with a different internal implementation.

In the new interface, there is a single argument --ssh-jump, which
accepts values in the form user@host:port.  Cleartext SSH passwords on
the CLI are no longer accepted.  The user will be prompted for a
password if the connection is not otherwise configured.

Deprecated arguments such as --ssh-host now refer to --ssh-jump.

Remote sockets are accepted.  The user should give the MySQL endpoint
exactly as it would be accepted from the jump host.

A keyring field is added for the ssh-jump value, if any, but the field
is not appended unless present, so existing keyring values are not
invalidated.

The internals of the new implementation are completely different:
instead of using complex Python libraries (paramiko/sshtunnel) we
simply open a tunnel using the ssh executable in a thread.  This is
more robust in a few ways: paramiko for example is not capable of
reading nontrivial SSH config files.

A new [ssh] section is added to myclirc with some recommended CLI
arguments to SSH when establishing tunnels.
@rolandwalker rolandwalker force-pushed the RW/ssh-jump-restore branch from 864159d to 0f22cdf Compare July 6, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-implement SSH tunnels, using ssh as the driver

1 participant