An easy to use libssh wrapper to execute commands on a remote server via SSH with Python.

You can go straight to the API documentation here: Reference/API.


pystassh is a Python 3 library that allows you to easily run commands on a remote server via SSH.


Currently supported versions and implementations of Python are:

  • python 3.6+
  • pypy3

Others might be compatible but are not officially supported.


Required libraries are automatically installed when installing pystassh (see Installation to learn more). You can install them by running pip install -r requirements.txt.

libssh and libffi-dev may have to be installed separately.