Skip to main content

Bindings for libssh2 C library

Project description

Super fast SSH2 protocol library. ssh2-python provides Python bindings for libssh2.

License Latest Version Latest documentation


Binary wheel packages are provided for Linux, OSX and Windows, all Python versions. Wheel packages have no dependencies.

pip may need to be updated to be able to install binary wheel packages - pip install -U pip.

pip install ssh2-python

For from source installation instructions, including building against system provided libssh2, see documentation.

Who Should Use This

Most developers will want to use the high level clients in parallel-ssh based on this library.

This library provides bindings to the low-level libssh2 C-API. It is not high level, nor easy to use. A lot of code would need to be written to use this library that is already provided by parallel-ssh.

Use parallel-ssh unless really sure using a C-API is what is wanted.

API Feature Set

At this time all of the libssh2 API has been implemented up to the libssh2 version in the repository. Please report any missing implementation.

Complete example scripts for various operations can be found in the examples directory.

In addition, as ssh2-python is a thin wrapper of libssh2 with Python semantics, its code examples can be ported straight over to Python with only minimal changes.


See examples directory for complete examples.

Again, most developers will want to use parallel-ssh rather than this library directly.

Comparison with other Python SSH libraries

Performance of above example, compared with Paramiko.

time python examples/
time python examples/


real       0m0.141s
user       0m0.037s
sys        0m0.008s


real       0m0.592s
user       0m0.351s
sys        0m0.021s

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssh2-python-1.0.0.tar.gz (2.6 MB view hashes)

Uploaded source

Built Distributions

ssh2_python-1.0.0-cp310-cp310-win_amd64.whl (6.7 MB view hashes)

Uploaded cp310

ssh2_python-1.0.0-cp39-cp39-win_amd64.whl (6.7 MB view hashes)

Uploaded cp39

ssh2_python-1.0.0-cp38-cp38-win_amd64.whl (6.7 MB view hashes)

Uploaded cp38

ssh2_python-1.0.0-cp37-cp37m-win_amd64.whl (6.7 MB view hashes)

Uploaded cp37

ssh2_python-1.0.0-cp36-cp36m-win_amd64.whl (6.8 MB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page