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.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

ssh_python-0.3.0-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.0.tar.gz.

File metadata

  • Download URL: ssh-python-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3b8b8227e27706d277a720a4b5adad1049d12053577f3db2fb1d6bb007d9329e
MD5 3bceefbea0a8a051c5d3d902c364dc15
BLAKE2b-256 8eb377a9a67204c87de201f1371a22621c305df16df83b287baf1e3d15de0066

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e6ced3e830d3f8e77cf6c44ee372b147a95b54351ac1d311734ad74d91487dc
MD5 d96cffc58c7faac929420509e3b22d46
BLAKE2b-256 926143f9638e5100216b12a9054285a07646c29c165e212cba4a9ed7738a4bf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e7736d37cb9eabce0970a16d0a23a675dc53f7b79edc95df73c0060e0d554df1
MD5 30966704a03cca16ce4ee32e3512337f
BLAKE2b-256 ed49d081efaa6c325ba9462036ebab32817005000c4cd4878e50a1b146fc98d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ca86664ff79334403e6380a5641ebad6732e77b7ddd1ff4f5356037ebda81257
MD5 be1a51673fa4e604f0e6bc8c49319d85
BLAKE2b-256 dac45485506901e84ea7b6c89045ce72ee8fde3025ee83fd27e3621bd8d57b13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9c634ce7f5541a74e8a67826151d7a4c116fdfacb177532d784d1c561dd469b2
MD5 4064b283454fac484b7ee26b45e0f48c
BLAKE2b-256 71548913d240f30121106d3a37572a43b9a14359eeda7d1708e07ff327091782

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3f5f1e3e3ac44900785f60ccba7c71cd485fe1188f3726c4f6380d7665854744
MD5 193c6ac0da37ecf5d7cfb964ae25b5b2
BLAKE2b-256 5b4346e3125b3b5da3ae0ac006673d66b331d97620776565a5ee53d1759c2621

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_python-0.3.0-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.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3e602688f50c574229b0c80944144b58d2b6782bbe1aea4af25f09ed8554635b
MD5 0585b66431092eaeb30eae865fecab66
BLAKE2b-256 a2a1060cb617e6ab6faa7e31e729078df7db617901d302efb58e7c434084b9f0

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