Skip to main content

Wrapper for libssh C library.

Project description

Bindings for libssh C library.

License Latest Version

Installation

Currently only installation from source is provided. Binary wheels to follow.

To install from source, run the following:

pip install ssh-python

Project is beta status.

Prerequisites

  • OpenSSL or gcrypt library and development headers

  • Optionally Zlib library and development headers for compression

Libssh source code is embedded in this project and will be built when installation is triggered per above instructions. Versions of libssh other than the one embedded in this project are not supported.

Quick Start

from __future__ import print_function

import os
import pwd

from ssh.session import Session
from ssh import options

USERNAME = pwd.getpwuid(os.geteuid()).pw_name
HOST = 'localhost'

s = Session()
s.options_set(options.HOST, HOST)
s.connect()

# Authenticate with agent
s.userauth_agent(USERNAME)

chan = s.channel_new()
chan.open_session()
chan.request_exec('echo me')
size, data = chan.read()
while size > 0:
    print(data.strip())
    size, data = chan.read()
chan.close()

Output:

me

Features

The library uses Cython based native code extensions as wrappers to libssh.

  • Thread safe - GIL is released as much as possible

  • Very low overhead thin wrapper

  • Object oriented - memory freed automatically and safely as objects are garbage collected by Python

  • Use Python semantics where applicable, such as context manager and iterator support for opening and reading from channels and SFTP file handles

  • Raise errors as Python exceptions

Download files

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

Source Distribution

ssh-python-0.3.0rc1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

ssh_python-0.3.0rc1-cp37-cp37m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.7m

ssh_python-0.3.0rc1-cp36-cp36m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.6m

ssh_python-0.3.0rc1-cp35-cp35m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.5m

ssh_python-0.3.0rc1-cp34-cp34m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.4m

ssh_python-0.3.0rc1-cp27-cp27mu-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 2.7mu

ssh_python-0.3.0rc1-cp27-cp27m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 2.7m

File details

Details for the file ssh-python-0.3.0rc1.tar.gz.

File metadata

  • Download URL: ssh-python-0.3.0rc1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh-python-0.3.0rc1.tar.gz
Algorithm Hash digest
SHA256 1e0e5ba1a11469c3bd05bb240adf96081b2626c53f2af9e28c1467c658bc80eb
MD5 d8455277f660b876673db304bd9664bf
BLAKE2b-256 cdec7b7571e55b3191c00b6e247abf1812d9a6293f71b71f84859a58890e1ecc

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2c14e1181279a81280859e75f47815b5044bed71f489abbcde0fed4d9beca687
MD5 2bdf473c5a342aea77961acded4f05c0
BLAKE2b-256 5adb9f40ce32a40de1f9a0749a58182c7fd6b0e150624f4880cbb9c39211c979

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fe9b5524642b5f0ba21bc3d17ddb8600c4543bd7021b68af5c7d366416f16350
MD5 2cb76a8d07538dac112112adf445113c
BLAKE2b-256 bfbd7b6bcd4d5b0368c5a9a770ffecd25a1139482cb32411252430d11d627bc3

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dd0f6a1726b550e4f8a73d9639185badbcd49be6f41ba0b5d7687d3dc9afe36b
MD5 bc5e12619413661ac13f351dd786262f
BLAKE2b-256 4e75485860f1bbbcf00585322f9466c67b3bd9e6727c3c43b7e9c0a01a839f9c

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 349d76d092d93cf65e1a20a5d9a751b6568f49ad93f9342efb1f4abba4536d04
MD5 168998d1b4f4f3c126e5f984d8d142dc
BLAKE2b-256 c481ef2bce2ec4b46fe732ee78fc70258fd3857d9c11d7cf099dd3a98d790b5c

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 33bcbacac05eb7e2ef9e0cbf261a0ce4f70b19c38b72688e701a9818daaf195d
MD5 a27e08374647278c7fe8ac97489e16c9
BLAKE2b-256 6419422502d66e36d2db658b86d18a53f94021b3e84645b1140a72a5fc762364

See more details on using hashes here.

File details

Details for the file ssh_python-0.3.0rc1-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.3.0rc1-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for ssh_python-0.3.0rc1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 677050b07321c3a5330cdbecb55cb7e6a64917976e528e69a5c12321a218c0dd
MD5 787e7017fb5f49285685c72dfda74edc
BLAKE2b-256 de42db45d0039179cff6f42d399d7718e5bf902780b00bca0310689a8e67dd98

See more details on using hashes here.

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