ssh-python
libssh C library bindings for Python.
What it is and what it does
ssh-python provides direct Python bindings to libssh, a C library for SSH client operations. It exposes low-level SSH functionality with minimal overhead, releasing the GIL during C operations to enable threading. The library uses Python idioms where applicable—context managers for channel/file handle cleanup, iterators for reading data—and automatically manages memory as objects are garbage collected.
The package is intended for developers who need direct, efficient access to SSH operations without the abstraction layers of higher-level libraries. It supports thread-safe concurrent operations within libssh's threading model, making it suitable for applications that execute multiple SSH commands or transfers in parallel. Binary wheels eliminate compilation requirements for common platforms and Python versions.
Use it for:
- Execute remote commands on multiple servers concurrently with minimal overhead in parallel SSH tools.
- Transfer files over SSH with direct control over connection and channel management.
- Build low-latency SSH client applications where GIL contention or abstraction overhead matters.
- Integrate SSH capabilities into systems that require thread-safe, non-blocking remote operations.
- Access libssh features not exposed by higher-level Python SSH libraries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python bindings to the libssh C library for SSH client operations, with thread-safe, low-overhead access to remote command execution and file transfer over SSH.
Yes, if you need direct, efficient SSH client bindings and are comfortable with a lower-level API. The library is production-stable, has no runtime dependencies, and provides good platform coverage via binary wheels. However, the aging maintenance status (306 days since last release) and small community (48 GitHub stars) mean you should verify active support for your use case before committing to it in new projects. Consider higher-level alternatives like paramiko if you prioritize ease of use and active development.
Install
ssh-python on PyPI
pip
pip install ssh-pythonuv
uv add ssh-pythonpoetry
poetry add ssh-pythonInstalling ssh-python
Before you install
Binary wheels available for Linux (manylinux 2014, x86_64 and aarch64), macOS (versions 12, 13, 14), and Windows 64-bit. Wheels have no dependencies. Last release was 306 days ago; repository is not archived but marked as aging.
License in practice
Licensed under LGPL-2.1-only (copyleft). Any derivative work or distribution must comply with copyleft obligations, including providing source code and allowing modifications under the same license terms.
Quickstart
pip install ssh-python
import ssh
# See command execution example in repository for usage patterns
Requires Python 3.8 or later. Binary wheels are pre-built; source builds require libssh development headers and a C compiler.
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode (last commit 2025-10-21, but status marked 'aging').
- Specific libssh version targeted by the bindings and any known compatibility constraints.
- Performance characteristics and overhead compared to other SSH libraries (e.g., paramiko, fabric).
Package facts
| License | LGPL-2.1-only (copyleft) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 306 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 213,449/month — #9,436 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ssh_python-1.2.0.post1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp310-cp310-win_amd64.whl; ssh_python-1.2.0.post1-cp311-cp311-macosx_12_0_arm64.whl; ssh_python-1.2.0.post1-cp311-cp311-macosx_13_0_arm64.whl; ssh_python-1.2.0.post1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp311-cp311-win_amd64.whl; ssh_python-1.2.0.post1-cp312-cp312-macosx_14_0_arm64.whl; ssh_python-1.2.0.post1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp312-cp312-win_amd64.whl; ssh_python-1.2.0.post1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp313-cp313-win_amd64.whl; ssh_python-1.2.0.post1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; ssh_python-1.2.0.post1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; ssh_python-1.2.0.post1-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
ansible-pylibsshPython bindings to libssh that provide SSH…
copyleft · top 15,000 on PyPI
ssh2-pythonssh2-python provides Python bindings to…
copyleft · top 15,000 on PyPI
parallel-sshAsynchronous SSH client for running commands on…
copyleft · top 15,000 on PyPI
pykaosPyKAOS provides an abstraction layer for agents…
unclear · top 15,000 on PyPI
cibuildwheelAutomates building and testing Python wheels…
permissive · top 5,000 on PyPI
sysrsyncWraps the system rsync command for Python,…
unclear · top 15,000 on PyPI
scpProvides file transfer over SSH using the SCP…
copyleft · top 5,000 on PyPI
jumpsshJumpSSH runs commands on remote servers through…
permissive · top 15,000 on PyPI
sshuttlesshuttle creates a transparent proxy that…
copyleft · top 15,000 on PyPI
pyhelper-utilsProvides a collection of utility functions for…
permissive · top 15,000 on PyPI