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.5.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a2e358562026264672baf379f96e5b9c37492296037a7ea5201a9e6188ab9fc |
|
MD5 | 4a097818f175f61cb04450e6bd3229a9 |
|
BLAKE2b-256 | a293d395bfd975b43125f716fad2967ba882c403d344d6c654ccd51b80161ece |
Hashes for ssh_python-0.5.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceefa04165ffdee6cba12eb99735537028cedab7b04598bd0c54751881f13532 |
|
MD5 | e0f5c3c1e4ba12205a25c398800e2208 |
|
BLAKE2b-256 | f46672e4fee8ab08205efcfe52096344e774048b95bea527d989e4e94cfdcb83 |
Hashes for ssh_python-0.5.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40002e2fab94a9a287f7ee8792b5b81f20f8b81baaeec797534abb9c1f5f01ba |
|
MD5 | 3249e678ee6d1645e03352d8a2c8be14 |
|
BLAKE2b-256 | 79a03acc4ba4ecc6a53cfd4efbc480f87ddab43ff4de50cea95ff5d66be4b6bd |
Hashes for ssh_python-0.5.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545c52512b69f753e882067fa4203e2ffbdf009426f53b88387570d411756ede |
|
MD5 | 65662c3061da4f9f3a2dfcdd87e73721 |
|
BLAKE2b-256 | 772303c7868c0635120bb18800a32a3a36cdd02a99a0338135e2a918b2ce99f0 |
Hashes for ssh_python-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09afc9842d98d63f453002e67403e6a8cf7a66f319b8c1e509e38356faab160c |
|
MD5 | 99bb61d7890135345e3dbc328ca5824e |
|
BLAKE2b-256 | 178beefa6c9964b8f22057c3db174e2590e1c4864a7dcdbe08f47681e948da32 |
Hashes for ssh_python-0.5.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ba7128503df64fdbaa389e041ae793ad648933bcc6986bf1637b142b06cdee |
|
MD5 | 4ff03e9469db54b92cab16f540f5d0f2 |
|
BLAKE2b-256 | 448f6f417d44986776dee78ea613ef4428e3e3340f402a12394dc3d352006751 |
Hashes for ssh_python-0.5.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d437796d8133e49b366d140429ab2e0ee3ce22fc32a43cec78184e78474b2669 |
|
MD5 | 3c6155472efbf54358d7b689d84d7136 |
|
BLAKE2b-256 | 10c0e51f023ae7998fa6a4dcfe107d799255fd433f70361f9b7589b1f145222c |
Hashes for ssh_python-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e154dca7731ba27f733cb9cf3b188cc90e249cb38c993a30293b8d5c14a17cca |
|
MD5 | 777a960a652e88041fa4abd323e934e4 |
|
BLAKE2b-256 | 6eaa5b3cc63c34d969bf4148e1e81cbf46c101fd8e9b54e9dab476a312074c9d |
Hashes for ssh_python-0.5.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d584bb2205851f8ec3a8f5efdb4903326f58c4ebc1353a07f9f0b8537bb1fe0a |
|
MD5 | 627e5522bdafa5d8fdf44d0884b1fd7c |
|
BLAKE2b-256 | e21acbbb29c930a6ffd833d453155f1c904fd3672175a4d76f3f7671da9012d5 |
Hashes for ssh_python-0.5.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423745cbe8d29733d886bbd6104eae1b624fbb8f8ffc62bcc55a9f853dfa2b2e |
|
MD5 | d64615e04a53d2be61beb2d082c252b0 |
|
BLAKE2b-256 | 0f20dd1d734682fb54e4f52a7041156cc5c93c5254ada6dc3bc61a4c9c4be572 |
Hashes for ssh_python-0.5.0-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e363b1220d26c43dc51a8bb97500b70dd2d2f669118a2b48ebef946c5e3348c6 |
|
MD5 | 5b3d09685a39ef29cc583ab9853a5fc9 |
|
BLAKE2b-256 | b4881a1a38493253541cfbddde4bfa580c7cf5f002d53d447eb724a598895220 |
Hashes for ssh_python-0.5.0-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfef007e1a80217789efa10537d1aab8207972895b5daafa69bbf4c306e2a7ab |
|
MD5 | 86b77a5f7f1c4c0f5e99742d2a93c218 |
|
BLAKE2b-256 | 7c424c686d568fb588e1209ec8f10428df5675f4fea348d34d6fee8e92aeb5cf |