sshtunnel
Pure python SSH tunnels
Decision gist · record as of 2026-08-14
Yes, with conditions. The package is stable and widely used (top 1000 on PyPI), has no known vulnerabilities, and solves a real problem cleanly. However, the last release was 2021 and the project is marked as aging. Install it if you need SSH tunneling and are comfortable with a mature but not actively maintained library; consider monitoring for any paramiko compatibility issues or security updates in your dependencies.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires paramiko to be installed; SSH credentials (password or key file) and network access to the SSH server are necessary at runtime.
- Low friction: pure Python wheel with a single runtime dependency (paramiko).
- Maintenance status is aging—last release was 2021-01-11, over four years ago, though the repository remains active and unarchived.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you include the license notice.
last release 2021-01-11 (2041 days) · last repo commit 2025-08-27 · 1,295 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 28,696,904 downloads/mo, #829 on PyPI
Alternatives
Verify before relying
pip install sshtunnel
from sshtunnel import SSHTunnelForwarder
server = SSHTunnelForwarder(
'remote.host',
ssh_username='user',
ssh_password='pass',
remote_bind_address=('127.0.0.1', 8080)
)
server.start()
print(server.local_bind_port)
server.stop()- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the highest tested version).
- Current state of compatibility with recent paramiko versions and modern SSH key formats.
- Whether the aging maintenance status (last release 2021) affects stability or introduces security gaps in active use.
What it is and what it does
sshtunnel wraps paramiko to create SSH port-forwarding tunnels from Python, solving the common problem of accessing services on remote networks that are blocked by firewalls or not directly reachable. It lets you bind a local port to a remote service through an SSH gateway, forwarding traffic transparently. The package supports both simple password authentication and key-based authentication with optional passphrases, and can chain multiple tunnels together for multi-hop scenarios.
You can use it either as a context manager (which handles startup and cleanup automatically) or by calling start() and stop() manually. It also provides a command-line interface for quick tunnel setup without writing code. The single runtime dependency is paramiko, which handles the SSH protocol details.
Use it for
- Access a database (MySQL, PostgreSQL) running on a private network by tunneling through an SSH bastion host.
- Connect to a web service or API running on a remote server that is only reachable via SSH, binding it to localhost.
- Set up multi-hop SSH tunnels to reach deeply nested private servers through multiple gateway machines.
- Automate SSH tunneling in deployment or testing scripts where manual ssh -L commands are impractical.
- Forward a Vagrant or Docker container port through SSH for local development against remote infrastructure.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
The package is stable and widely used (top 1000 on PyPI), has no known vulnerabilities, and solves a real problem cleanly. However, the last release was 2021 and the project is marked as aging. Install it if you need SSH tunneling and are comfortable with a mature but not actively maintained library; consider monitoring for any paramiko compatibility issues or security updates in your dependencies.
Install
sshtunnel on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (paramiko). Maintenance status is aging—last release was 2021-01-11, over four years ago, though the repository remains active and unarchived.
Requires paramiko to be installed; SSH credentials (password or key file) and network access to the SSH server are necessary at runtime.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you include the license notice.
Quickstart
pip install sshtunnel
from sshtunnel import SSHTunnelForwarder
server = SSHTunnelForwarder(
'remote.host',
ssh_username='user',
ssh_password='pass',
remote_bind_address=('127.0.0.1', 8080)
)
server.start()
print(server.local_bind_port)
server.stop()
Verify before relying
- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the highest tested version).
- Current state of compatibility with recent paramiko versions and modern SSH key formats.
- Whether the aging maintenance status (last release 2021) affects stability or introduces security gaps in active use.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageparamiko |
| Maintenance | Aging 2,041 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 28,696,904 / month, #829 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Build Tools |
Evidence: sshtunnel-0.4.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ssh port forwarding”
- sshtunnelEstablishes SSH tunnels to forward local ports to remote services,…
- sshuttlesshuttle creates a transparent proxy that tunnels traffic over SSH to…
- asyncsshAsyncSSH provides an asynchronous SSH client and server…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also jumpssh · pyngrok · sshconf · sshuttle · proxmoxer · scp · pproxy · prime-tunnel · paramiko-expect · paramiko