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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2309d07ba9622bfa0c1d81e6888269b4782764d06a751eae5c7d36739b834691
|
|
| MD5 |
e63fca7578bf53c6750b2c417c79e8d7
|
|
| BLAKE2b-256 |
f30482ef8dc0456c8036e1c9b80395a3ffe7cdced655dbb583286ae5d14dc2e1
|
Provenance
The following attestation bundles were made for sshtunnel2-0.4.1.tar.gz:
Publisher:
publish.yml on andyxuanq110/sshtunnel2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sshtunnel2-0.4.1.tar.gz -
Subject digest:
2309d07ba9622bfa0c1d81e6888269b4782764d06a751eae5c7d36739b834691 - Sigstore transparency entry: 2152893461
- Sigstore integration time:
-
Permalink:
andyxuanq110/sshtunnel2@8c32dd289d06816d4fda999903e445330e31b646 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/andyxuanq110
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c32dd289d06816d4fda999903e445330e31b646 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcfa7e7cdd6dcab24c4b36ef187a6ae386e462e0dcf20ef99d91eac5f4009a2d
|
|
| MD5 |
9d4a8784c7de10fa2f0a0bad763d5163
|
|
| BLAKE2b-256 |
c170bd168e6f2fb0bb170e9f5a5c263a8a2d7a4aded8fd902148f7cbf5b3ee2e
|
Provenance
The following attestation bundles were made for sshtunnel2-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on andyxuanq110/sshtunnel2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sshtunnel2-0.4.1-py3-none-any.whl -
Subject digest:
dcfa7e7cdd6dcab24c4b36ef187a6ae386e462e0dcf20ef99d91eac5f4009a2d - Sigstore transparency entry: 2152893647
- Sigstore integration time:
-
Permalink:
andyxuanq110/sshtunnel2@8c32dd289d06816d4fda999903e445330e31b646 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/andyxuanq110
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c32dd289d06816d4fda999903e445330e31b646 -
Trigger Event:
push
-
Statement type: