--- id: ssh2-python version: "1.2.0.post1" license: LGPL-2.1-only license_treatment: copyleft maintenance: active --- # ssh2-python — Bindings for libssh2 C library License: copyleft · Maintenance: active · Downloads: 317.0K/mo ## What it is and what it does ssh2-python is a thin Python wrapper around libssh2, the C library that implements the SSH2 protocol. It exposes the low-level libssh2 API directly to Python, allowing developers to perform SSH operations with minimal overhead. The package is distributed as pre-compiled binary wheels for major platforms and Python versions, with no runtime dependencies. This is intentionally a low-level binding, not a high-level client library. It requires manual management of sessions, channels, and authentication, and substantial boilerplate code for common tasks. The documentation explicitly recommends that most developers use higher-level clients instead, which provide a simpler interface built on top of ssh2-python. Use ssh2-python only if you need direct control over libssh2 semantics or are building a specialized SSH tool. Use it for: - Building a custom SSH client or server with fine-grained control over protocol behavior and performance. - Implementing SSH functionality in performance-critical applications where C-API overhead matters. - Porting existing libssh2 C code examples to Python with minimal changes. - Creating SSH automation tools that require low-level session and channel manipulation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ssh2-python provides Python bindings to libssh2, a low-level SSH2 protocol library, enabling direct access to SSH2 operations via C-API semantics. Yes, if you need direct libssh2 bindings and understand the low-level API. No, if you want a simple SSH client—higher-level alternatives are recommended. The package is stable, actively maintained, has no known vulnerabilities, and offers good platform coverage. The LGPL-2.1-only license requires derivative works to be released under the same license, which may constrain proprietary use. ## Install pip install ssh2-python uv add ssh2-python poetry add ssh2-python ## Installing ssh2-python Before you install: Binary wheels are provided for Linux, macOS, and Windows across Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14, with no runtime dependencies. Install friction is medium due to the compiled nature of the bindings, but pre-built wheels eliminate build-time complexity for most platforms. Repository is actively maintained with a recent commit on 2026-06-12. License in practice: Licensed under LGPL-2.1-only (copyleft). Any derivative work or modification must be released under the same license; static linking or bundling may trigger additional obligations depending on your distribution model. Quickstart: pip install ssh2-python import ssh2 session = ssh2.Session() session.handshake('hostname') session.userauth_password('user', 'password') channel = session.open_session() channel.execute('ls') size, data = channel.read() print(data.decode()) Requires a working SSH server to connect to; this is a low-level C-API wrapper and demands manual session and channel lifecycle management. Verify before relying: - Whether the package supports key-based authentication or only password authentication. - What the minimum Python version is (requires_python is unspecified in metadata). - Whether PyPy support is actively tested or only declared in classifiers. ## Package facts - License: LGPL-2.1-only (copyleft) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 317.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ssh2 protocol bindings, libssh2 python wrapper, low-level ssh library, ssh2 c api bindings, fast ssh implementation, ssh-protocol, c-bindings, low-level-api [View on SkillFed](https://skillfed.io/packages/ssh2-python) · [View on PyPI](https://pypi.org/project/ssh2-python/)