skillfed

ssh-python

libssh C library bindings for Python.

ssh-python v1.2.0.post1 213.4K downloads/30d#9,436 on PyPI48
Copyleft license LGPL-2.1-only AGING released

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-python

uv

uv add ssh-python

poetry

poetry add ssh-python

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: BSDOperating System :: POSIX :: LinuxProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: NetworkingTopic :: System :: Shells

Tags

ssh client library pythonlibssh python bindingsremote command execution sshssh file transfer pythonthread-safe ssh clientlow-level ssh bindings
ssh-clientc-bindingslow-level

More Libraries packages