Skip to main content

libssh C library bindings for Python.

Project description

Bindings for libssh C library.

License Latest Version https://circleci.com/gh/ParallelSSH/ssh-python/tree/master.svg?style=shield https://img.shields.io/pypi/wheel/ssh-python.svg https://img.shields.io/pypi/pyversions/ssh-python.svg

Installation

Binary wheels are provided for Linux, OSX and Windows wheels to follow.

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

# Linux only
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 released as much as possible

  • Very low overhead thin wrapper

  • Object oriented * Memory freed automatically and safely as objects are garbage collected by Python

  • Uses Python semantics where applicable * channel/file handle context manager support * channel/file handle iterator support

  • Raises low level C errors as Python exceptions

Project details


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.4.0.post4.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

ssh_python-0.4.0.post4-cp39-cp39-manylinux2010_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp38-cp38-manylinux2010_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp37-cp37m-manylinux2010_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp36-cp36m-manylinux2010_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp35-cp35m-manylinux2010_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp27-cp27mu-manylinux2010_x86_64.whl (6.5 MB view details)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

ssh_python-0.4.0.post4-cp27-cp27m-manylinux2010_x86_64.whl (6.5 MB view details)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

File details

Details for the file ssh-python-0.4.0.post4.tar.gz.

File metadata

  • Download URL: ssh-python-0.4.0.post4.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh-python-0.4.0.post4.tar.gz
Algorithm Hash digest
SHA256 3c6524c531398741ab20c94ac703ed8c918c23f160faae34a0bd0928fd2eda45
MD5 1f2a827f3b1fd57c331df868253c69dc
BLAKE2b-256 1a97174fd48eeecae7fbee8880d4efe63a64eff44928ab79d9a918dd719ff8e0

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 041be928be0e07e2f97c63a82136c884059d50f1c26c293612f91c71cc5b90d8
MD5 03afcbf3d8600721ce5f7b513e4c48dc
BLAKE2b-256 5510fd82d7662b13ba61ba92be90828440b1f7202fdd46991bf6c3ef77f8daed

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 dbb423b17491d007aa0c241a29315f7cd2b10f221b27dfb5a2efa9773780effa
MD5 d9d6fe9e10622400ac3b5ad8e35b7e96
BLAKE2b-256 a656e0d8259ee6673b0957e532f5859a08e49dd57beb3a4451f69bc4fa4c3236

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a06a44da6fbacbc34fa984ba392892434cb0a61481a4f8968dc4cae5787cca5d
MD5 fd127f979ce508988639fb3141461c8a
BLAKE2b-256 9407c17c2d328fca8e19531697e579bcb317f7d93f82e90bd23ae8d21f92d7ce

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4498a6ada4e814f926da734ceb1ca6598b90c6b6c914484ce7a58ecac50c225c
MD5 7607b6d4b42b383234e88816f77d6c6b
BLAKE2b-256 74869af180edbac10a774d161a3023511bbe84f5396d20eaf371654d5fded389

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.7 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a64089029990ac6f10720a10ac00f15856c1b7546a8dd15bf52e0b50d669611e
MD5 9d73f5577eda7a6f6f9d6c7edb83d7fa
BLAKE2b-256 429b361b6eac6d2715f96b434dddf116db416898c4937f1fa890e71651ad8d54

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp27-cp27mu-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp27-cp27mu-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f147ba6003f072ad856ae123bcc547057be7e2427792da276dfd276caa9fac41
MD5 95888db52a52e723208acad94a083184
BLAKE2b-256 b4dd8b0cbc3610e2e9512d962594115955f77a51d82bfdb570c82d0611d57ef7

See more details on using hashes here.

File details

Details for the file ssh_python-0.4.0.post4-cp27-cp27m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ssh_python-0.4.0.post4-cp27-cp27m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/20.10.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.12

File hashes

Hashes for ssh_python-0.4.0.post4-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7e4b62a190b3ba316b425883309a3bcc0449ec225c124e6ddf2ddc21c9427175
MD5 3f4a984c191116ffcc9c18cb3f79b07b
BLAKE2b-256 66011cdaffb6cda2e9b85a18987ba62fafec10d69e45e88eba88753d02b7847a

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