libssh C library bindings for Python.
Project description
Bindings for libssh C library.
Installation
Binary wheels are provided for Linux (manylinux 2010), OSX (10.14 and 10.15 for brew Python), and Windows 64-bit (Python 3.6/3.7/3.8).
Wheels have no dependencies. For building from source, see documentation.
pip install ssh-python
Project is beta status, please report any issues.
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
libssh threading limitations apply - anything not supported in C is not supported in Python
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ssh_python-0.6.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efcd7d92a1691ff6dc31cd757abb3aa8a440419a3e69369c9af4b782d65b6371 |
|
MD5 | 1e558977b325e60d30749a1873703acf |
|
BLAKE2b-256 | 76df56ed51c769185a13a83b8b61f85196283c8dd260147c44d9d84b2dfec017 |
Hashes for ssh_python-0.6.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f521f300ca6623978ecf9f2b0c54956002ee950eb6131f6c45e5505ba86bd6c4 |
|
MD5 | 09e0085ddeb51721091531d96c2ff3b1 |
|
BLAKE2b-256 | d3a23df6066f859383f01c4d82c19b796994e3da59e68e575eb93f6258b0e2a5 |
Hashes for ssh_python-0.6.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfaa9651e1e7fbf758c3389028601920c7cbc8cc08dd15bcaa08cf8eec83dba9 |
|
MD5 | d04a8a07418ab09d1266ce8fb56da7b8 |
|
BLAKE2b-256 | 05b2048bcaaf72e28fc9da3c64ff44c0261feff10218909ade65e8647fba4e57 |
Hashes for ssh_python-0.6.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebd991f4abaedaf0dcc6ae005f473de50b97373bcb78831cb494e7e143b5b331 |
|
MD5 | 1f3d01b0dd43ed9d0760c94bad8e99e9 |
|
BLAKE2b-256 | 63755738c04e4869a8354a21be75a33f2968a37f5e552818692bcdc4385c4307 |
Hashes for ssh_python-0.6.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02d97fa0e1e7bd9a72bef99ab8d143181e5f24a17ed9d34af6ef011287bb1d54 |
|
MD5 | fc1f9daff8476caa60bf7423cefee531 |
|
BLAKE2b-256 | cfddbb4245b41666e9c95b3d454a5badc079447bb7ee246a03ab67e8ff28672a |
Hashes for ssh_python-0.6.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ce20ed648ae4b29618bcd51adcda3599c955d9351f9b69810c722540888d00 |
|
MD5 | c050fc3182feb13986fec48b31d08dd8 |
|
BLAKE2b-256 | 3dafbf9443d74405df8d288122b635d4e60863b8647681c7b5003c280ca01eb4 |
Hashes for ssh_python-0.6.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4872e36d110aa33a621508bcf514640ad96759d3dd57689ee8543fef89646ebf |
|
MD5 | 43f5aac9258b8c5bd76ea61af045e636 |
|
BLAKE2b-256 | e4089f4efe743bd508fb4ca8b72e890cb6e844f2a1965b667b9ad807a30d394e |
Hashes for ssh_python-0.6.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0de5345a0060c45ac2f6b5b7707d6a6511d19b1c1cc0dfe92ee0efe67019baf |
|
MD5 | 62cbf492ddebe1b8e81ef756cf5531f0 |
|
BLAKE2b-256 | 096094dce761b0d7f12a7f2a0688c409b72423b094cfbf04c0dceae521f2317e |
Hashes for ssh_python-0.6.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0598b91d04e26f64b3de55b75eadb23f6a69309c7a85a7e55949f48ae5a7f0 |
|
MD5 | 00bd2a4b3adaf6c910ec5fa7d58c3aea |
|
BLAKE2b-256 | 8632d00d4f3f3a4b05264aa31afc936d244967a07a108f36ce4d6ca79c6c362b |
Hashes for ssh_python-0.6.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d773187952cfe34cc4410e485344a66d9000f3522482a98bd81459f7dee9588e |
|
MD5 | 6edaeea37dd0c1912141f04836cca9fb |
|
BLAKE2b-256 | cc08a790678ce47e8d462b202cacd5c972897f4c810657c54764fc615cd18381 |
Hashes for ssh_python-0.6.0-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c65e4ed9d25cf5fdb4c0d3af724801f27f1d520804698f213372fdb7d1d9ec9 |
|
MD5 | cd8057ed2929d284e1b234ccd5698776 |
|
BLAKE2b-256 | 8320baf71b564e1af00000ceedc614b971111a24b9d5c420b95505b465103199 |
Hashes for ssh_python-0.6.0-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 925342290cf2e5f3a87fea3564731ca3131a5ee4c092ba9339e7b0ca443af654 |
|
MD5 | 1753cbcb8c8bce35aabc36358af7e3ae |
|
BLAKE2b-256 | 76bf444c290614a40d1f0ba5f926490b095d4ec885cb1387b51128ceb392797c |