Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
python bindings for libssh2 library
C Python C++
branch: master

Merge pull request #17 from bkerensa/master

Fix typos for the win
latest commit 79371a0168
christophe grosjean pykoder authored



:libssh2: Python module
:Copyright: Keyphrene, Wallix
:License: LGPL

pylibssh2 1.0.2

1.0.0 release, may 2010
1.0.1 release, july 2011
1.0.2 release, apr 2012
1.0.3 release, july 2012


pylibssh2 is a python binding for libssh2 library, it was forked and rewrote
from scratch using old org.keyphrene (

Sofian Brabez wrote this extension at Wallix ( to provide an easy
way to manage SSH2 connection through libssh2 library in python.

This is a C extension module to provide a high level python API. libssh2 API is
fairy well respected and export into a python API.

Packaging and API is documented with epydoc format. 


    - python 2.6+ <>
      (older version before 2.5 aren't supported and not recommended)
    - libssh2 1.2.1+ <>
      (older version after 0.18 can works too)

Linux Debian/Ubuntu::

    sudo aptitude install python2.6 python2.6-dev libssh2-1 libssh2-1-dev


    sudo make -C /usr/ports/lang/python install clean
    sudo make -C /usr/ports/security/libssh2/ install clean


Old parts from are licensied against GNU Lesser GPL (LGPL) and all
new and rewritten parts from are licensied against LGPL License too.


This is developed and tested mostly on Linux, though it should support others posix

Bugs & Support

Bug tracker is available at

Get the source code
    git clone

Browse the source code at

Download tarballs at


These following examples are located in examples/ directory.
    dummy version of scp upload file transfer.
    this example show how to list remote directories through
    SFTP protocol.
    this example show how to execute a SSH remote command execution.
    this example demonstrate how implement a partial ssh client to get a remote
    this example demonstrate how implement a X11 forwarding client.


API documentation can be generated with epydoc <> 
with following command line::

    epydoc --no-private -n pylibssh2 -o doc libssh2


    make doc


See the INSTALL file for installation instructions.

Don't hesitate to reports bugs and submit patches, or just mail author.
Something went wrong with that request. Please try again.