Skip to main content

Maintained drop-in fork of sshtunnel for Paramiko 3, 4, and 5

Project description

sshtunnel2

Maintained fork of sshtunnel. Drop-in runtime module: keep import sshtunnel. Fixes modern Paramiko crashes, including DSSKey removal.

Migration

Replace the dependency name only:

python -m pip uninstall sshtunnel
python -m pip install sshtunnel2

Your Python code should not change:

from sshtunnel import SSHTunnelForwarder, open_tunnel

sshtunnel2 intentionally installs the same top-level module name, sshtunnel, so it conflicts with the original PyPI package if both are installed in one environment. Install one or the other, not both.

Why This Fork

The original sshtunnel project is a useful MIT-licensed library by Pahaz White and contributors. It has also been effectively unmaintained for several years while Python, Paramiko, and OpenSSH have continued to change.

This fork keeps the original API and behavior, preserves the original copyright and MIT license, and limits the first release to maintenance: compatibility fixes, packaging, tests, and CI. New APIs and async support are out of scope for the first release.

Compatibility

Component Supported
Python 3.9, 3.10, 3.11, 3.12, 3.13
Paramiko 3.x, 4.x, 5.x
Public API Matches sshtunnel==0.4.0
Package name sshtunnel2
Import name sshtunnel

Fixed Upstream Issues

Upstream issue Status in sshtunnel2
#302 Fixed: no hard reference to removed paramiko.DSSKey.
#299 Fixed: DSA/DSS key support is discovered only when Paramiko exposes it.
#288 Fixed: start() cleans already-created local listeners when startup fails.
#170 Covered: shutdown is attempted for every created server, even failed tunnel checks.
#173 Covered: stop(force=True) avoids blocking on active handler threads during close.
#127 Covered by daemon-thread defaults retained from 0.4.0 and force-close tests.
#201 Covered by explicit close behavior and CI regression tests.

Development

Run the pure unit tests:

python -m pip install -e ".[test]"
pytest

Run lint:

python -m pip install -e ".[dev]"
ruff check .

Run a matrix locally with tox:

tox -e py312-paramiko3,py312-paramiko4,py312-paramiko5

Run the real OpenSSH integration test:

pytest -m integration

The integration test starts a local sshd subprocess when OpenSSH server tools are available. The GitHub Actions workflow runs the same test after installing openssh-server.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sshtunnel2-0.4.1.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sshtunnel2-0.4.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file sshtunnel2-0.4.1.tar.gz.

File metadata

  • Download URL: sshtunnel2-0.4.1.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sshtunnel2-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2309d07ba9622bfa0c1d81e6888269b4782764d06a751eae5c7d36739b834691
MD5 e63fca7578bf53c6750b2c417c79e8d7
BLAKE2b-256 f30482ef8dc0456c8036e1c9b80395a3ffe7cdced655dbb583286ae5d14dc2e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sshtunnel2-0.4.1.tar.gz:

Publisher: publish.yml on andyxuanq110/sshtunnel2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sshtunnel2-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: sshtunnel2-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sshtunnel2-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcfa7e7cdd6dcab24c4b36ef187a6ae386e462e0dcf20ef99d91eac5f4009a2d
MD5 9d4a8784c7de10fa2f0a0bad763d5163
BLAKE2b-256 c170bd168e6f2fb0bb170e9f5a5c263a8a2d7a4aded8fd902148f7cbf5b3ee2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sshtunnel2-0.4.1-py3-none-any.whl:

Publisher: publish.yml on andyxuanq110/sshtunnel2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page