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.7.0.post1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e58d3695ef3b71b4eb05f60f7d8d700e113959c476e892fd9c577e89b29d647 |
|
MD5 | b2e1802cebcd0297b0c841af26abb22a |
|
BLAKE2b-256 | c87e58acadc5209384f45e299b7c62cda417b37266b63c834cf1bb32dfd89b88 |
Hashes for ssh_python-0.7.0.post1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f43784d5dcb26bd30d95fe48546f4b127b2dfde491e3cc56a55f5691381475e9 |
|
MD5 | 6c3b91fe2a440d08b9d027a78e9a1537 |
|
BLAKE2b-256 | d81dd47cf4000c935f1d9aacd7972dd19b1a24478853c5b92764bf4c9894386c |
Hashes for ssh_python-0.7.0.post1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7d3817efca177bce75fac3c53af0e6ff6c892f034e4311f245a373a0afe353e |
|
MD5 | d61314a5c09509f9ffc2671d8c93acdb |
|
BLAKE2b-256 | 67638747773614fa2323fbacbfe37b72bf2ee81f075c59213a1c4e7a6189e20a |
Hashes for ssh_python-0.7.0.post1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2aca2326fed21573611ff5c2d8dbf3ce5c335273b9d2714e346039ec9bc1480 |
|
MD5 | 1f66b426e03e5f737ba5de797b6de36f |
|
BLAKE2b-256 | d196163700137819a72d0a76d0c5bdedea01df8cef544a12e48b5e04cac1912c |
Hashes for ssh_python-0.7.0.post1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb4f105c30a9eed92cc6208fa05ae83f2e52a58d0981824104546849bbc01a1 |
|
MD5 | 01874f7b84e72de585dfa0c071d21bbe |
|
BLAKE2b-256 | 1d684c2226702abfeea1388ada65d56f16ebea5af62661fc83aac74091143012 |
Hashes for ssh_python-0.7.0.post1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8948d0bc7ae2aad4f57420285f838b0223256d4bdb5ad646b03fcb5c5f3044a |
|
MD5 | 204bcb70032ccb341a69aeba145c95d7 |
|
BLAKE2b-256 | ece60cbd4693b5fb68e0008f2d1bcf12292f09031223e424f3e147cd7943c897 |
Hashes for ssh_python-0.7.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a5ed336ffa26a48d937f4d892249a6af5220669a7d461cb74627c8982740542 |
|
MD5 | 904723fe65ae8c45bb5cae70c740ed49 |
|
BLAKE2b-256 | 5269e8af90843651c61fa1d568a06004b882e34ea96cdcf6f7be9bb7896bb924 |
Hashes for ssh_python-0.7.0.post1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d06f9b7a64937a24ce9edc21fc9ab4496d3799012ca4a5c13ff53e48fde30150 |
|
MD5 | 6556cfb0d8c92743fc55d1ee7c98374d |
|
BLAKE2b-256 | 5df6bc32efc34b301229e3c30bc2badc8c626e67944dfd7243851f4612720331 |
Hashes for ssh_python-0.7.0.post1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c995e63953a535bd47f1700ee983506e0facdb2bbd165c022ab95bfc79eb9932 |
|
MD5 | b1f741a6cc47f3027e636b192e7ecdf5 |
|
BLAKE2b-256 | 18f2974154552e28f904669065a29cf4d87697a11bc36a4cfb3e0a5613243934 |
Hashes for ssh_python-0.7.0.post1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428cc3e30a320efa1ff1896b4963c1c129921afa2b11683d85d0625742390b47 |
|
MD5 | 6b8b2a03425984ddfbbdf6bee4b46e08 |
|
BLAKE2b-256 | a3ce4b815c84b366dee9aa22265a48f4d216ff7dce22d8ac6c9c90cdc9582153 |
Hashes for ssh_python-0.7.0.post1-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698b2b06c8bb95525a1b0871fa8e09ec9424b2983bb5dd3a5d3eeefd2e173f28 |
|
MD5 | fac2f75ebd180f2f3688f6b22863912f |
|
BLAKE2b-256 | dc4c4276731bdf31695caa28862249c321ec5fbfe9398326c90da55355e182cc |
Hashes for ssh_python-0.7.0.post1-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0647530dd220304d9787cfbe1806348f073bb77fc20635b2fd8247c36fa1cb69 |
|
MD5 | 3548f673aff4e3a21a498bb0217b6f85 |
|
BLAKE2b-256 | cd70bb9f9164c4724b1dc261be9ace343c69db75c57417e4fe2a5ef7af88427c |