Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
32cec58
Session.userauth_keyboardinteractive method
dvolodin7 May 8, 2019
e06a6c6
flake8
dvolodin7 May 8, 2019
a27d6f7
Add libsssh2_session_method_pref
ArvydasVe May 8, 2019
7a6f58c
Merge pull request #1 from getCUJO/add_method-pref_function
ArvydasVe May 8, 2019
ba303f5
Add recompiled cython files
ArvydasVe May 9, 2019
b7e4cfa
Merge pull request #2 from getCUJO/add_method-pref_function
ArvydasVe May 21, 2019
51d0f51
userauth_password and userauth_keyboardinteractive tests
dvolodin7 Jul 5, 2019
56391d0
Fix test
dvolodin7 Jul 5, 2019
3309abf
Merge branch 'master' of github.com:ParallelSSH/ssh2-python
Red-M Nov 2, 2019
6147009
Merge github.com:dvolodin7/ssh2-python
Red-M Nov 2, 2019
539c435
Update libssh2 to 1.9.0 stable.
Red-M Nov 2, 2019
17fd808
Update README.rst
Red-M Nov 2, 2019
d78f1e1
Add python 3.8 to appveyor.
Red-M Nov 6, 2019
8161461
Fix docstring.
Red-M Nov 6, 2019
b9dd931
Add callback enum for c_ssh.
Red-M Nov 9, 2019
87cceeb
Fix flake8 errors.
Red-M Nov 9, 2019
796d341
Allow for global name import of the library.
Red-M Dec 8, 2019
1402813
Allow travis to ignore git LFS because the repo is over limit.
Red-M Dec 8, 2019
edbdc4c
Add additional builds on more python 3 versions.
Red-M Dec 8, 2019
e9af1c5
Regenerated Cython C files with 0.29.6
Red-M Dec 18, 2019
6189741
Regenerate Cython using 0.29.14
Red-M Dec 18, 2019
db6a4a6
Add extra host key types to support extra ciphers.
Red-M Feb 16, 2020
ea9cc12
Also add host key types to the ssh2 enums.
Red-M Feb 16, 2020
0be263e
Fix `ssh2.enums.HOSTKEY_TYPE` enum.
Red-M Mar 19, 2020
28ce1df
Turn libssh2 source tree into git submodule.
Red-M Jun 6, 2020
f9d9420
Renaming efforts.
Red-M Jun 6, 2020
1b1f7ed
Changes to push package up to pypi.
Red-M Jun 6, 2020
fbce2f9
Update README.rst.
Red-M Jun 6, 2020
e860fa3
Update README.rst.
Red-M Jun 6, 2020
276da93
Update README.md
Red-M Jun 8, 2020
a0dd7d0
gitlab ci
Red-M Jun 13, 2020
12f88cf
gitlab ci
Red-M Jun 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ environment:
ARCH: x64_86
SYSTEM_LIBSSH2: 1

- PYTHON: "C:\\Python38-x64"
PYTHON_VERSION: "3.8"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86
SYSTEM_LIBSSH2: 1

install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ zlib1211.zip filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/libssh2.tar.gz filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/cmake-2.8.11.1-5.4.x86_64.rpm filter=lfs diff=lfs merge=lfs -text
ssh2/_version.py export-subst
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ build
*.so
.idea/
ssh2/libssh2.so*
redlibssh2/libssh2.so*
src/
ci/docker/manylinux*/libssh2
__pycache__
conda-recipe
wheelhouse/
38 changes: 38 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

build_manylinux_wheel_release:
image: docker:dind
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
script:
- apk add --no-cache bash git
- git submodule update --init --recursive
- chmod +x ./ci/gitlab/build-manylinux.sh
- cp -r ./libssh2 ./ci/docker/manylinux_2010/libssh2
- ./ci/gitlab/build-manylinux.sh
artifacts:
paths:
- wheelhouse
only:
- master

test_build:
image: debian:stable
script:
- date
only:
- master

#~ tests_py3.5:
#~ image: debian:9
#~ script:
#~ - ./tests/scripts/install_root.sh GITLAB 3 5
#~ - ./tests/scripts/install.sh GITLAB 3 5
#~ - ./tests/scripts/test.sh GITLAB 3 5
#~ artifacts:
#~ paths:
#~ - htmlcov
#~ only:
#~ - master
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libssh2"]
path = libssh2
url = https://github.com/libssh2/libssh2.git
53 changes: 53 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
git:
lfs_skip_smudge: true
language: python
cache:
- pip
Expand All @@ -15,6 +17,7 @@ python:
- 3.5
- 3.6
- 3.7
- 3.8
addons:
apt:
packages:
Expand Down Expand Up @@ -147,3 +150,53 @@ jobs:
user: pkittenis
password:
secure: "eEBo76bmNWArLOzLNkv8whYO81HqkYpwUu3RqBHv6PNW/sI70VSIVfPTWo8ThlNkYSBy1Sxci6eU+Vd8qYH/vaCbl4068BkzroGUqGMLHXLRLEPQjO2pxTvnQ7Nbj/Mi9enoslLJKflx2USy2iPz1yGCWZrPzjLWmEMcx6j5e3fEUGF2p6p01w/zWxmiSoyJgBsby9P8Fl5nflsNMVR/or8frK4K1T6Y2oTuEx9aYymmBPFOO5DHaedDxnhZ04KKaACIECvKrT5V3PMM1jrE3qu6hJ1LS0/mSivEdCwCszHanjIQy/enkNtLgxVm4jIRUjuAwL1MmxPtkAUcKrQor1YokMqm5fExdwvnp+qjtyejfA3IvT93nYvCj4IEYNMDtUGFUBjsYLqg7Ked/jvO53Ek5WEAE/Mx8F/OAtuvkpEeUKTIWxfd+V0b7pgShVuU5zFyi3y97vpRtdwqzOFr8QT3Hq+g/RIdghPQ9pGQ3GOomTMO1B7mAyOG6SYyQM/wra2h2dQTHCbgzAtsPzZLiZhWIGcU7/mGLm0kZBT6McnH2//hsIPXG8S94u2MWE0KRH5YhJ/2ATWneYyFHWQfwqDeR/1CZe66gFcPJ9cOIG+8pcmXueLhnueDbh2EWa8jmumtrAz+z+rcokih0c7catT7pByDv24Ouuw2Yf3my60="

- stage: build packages
os: linux
python: 3.7
env:
- WHEELS=1
install:
- pip install twine
script:
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
- ./ci/travis/build-manylinux.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
fi
deploy:
- provider: pypi
skip_cleanup: true
on:
repo: ParallelSSH/ssh2-python
tags: true
distributions: sdist
user: pkittenis
password:
secure: "eEBo76bmNWArLOzLNkv8whYO81HqkYpwUu3RqBHv6PNW/sI70VSIVfPTWo8ThlNkYSBy1Sxci6eU+Vd8qYH/vaCbl4068BkzroGUqGMLHXLRLEPQjO2pxTvnQ7Nbj/Mi9enoslLJKflx2USy2iPz1yGCWZrPzjLWmEMcx6j5e3fEUGF2p6p01w/zWxmiSoyJgBsby9P8Fl5nflsNMVR/or8frK4K1T6Y2oTuEx9aYymmBPFOO5DHaedDxnhZ04KKaACIECvKrT5V3PMM1jrE3qu6hJ1LS0/mSivEdCwCszHanjIQy/enkNtLgxVm4jIRUjuAwL1MmxPtkAUcKrQor1YokMqm5fExdwvnp+qjtyejfA3IvT93nYvCj4IEYNMDtUGFUBjsYLqg7Ked/jvO53Ek5WEAE/Mx8F/OAtuvkpEeUKTIWxfd+V0b7pgShVuU5zFyi3y97vpRtdwqzOFr8QT3Hq+g/RIdghPQ9pGQ3GOomTMO1B7mAyOG6SYyQM/wra2h2dQTHCbgzAtsPzZLiZhWIGcU7/mGLm0kZBT6McnH2//hsIPXG8S94u2MWE0KRH5YhJ/2ATWneYyFHWQfwqDeR/1CZe66gFcPJ9cOIG+8pcmXueLhnueDbh2EWa8jmumtrAz+z+rcokih0c7catT7pByDv24Ouuw2Yf3my60="

- stage: build packages
os: linux
python: 3.8
env:
- WHEELS=1
install:
- pip install twine
script:
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
- ./ci/travis/build-manylinux.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
fi
deploy:
- provider: pypi
skip_cleanup: true
on:
repo: ParallelSSH/ssh2-python
tags: true
distributions: sdist
user: pkittenis
password:
secure: "eEBo76bmNWArLOzLNkv8whYO81HqkYpwUu3RqBHv6PNW/sI70VSIVfPTWo8ThlNkYSBy1Sxci6eU+Vd8qYH/vaCbl4068BkzroGUqGMLHXLRLEPQjO2pxTvnQ7Nbj/Mi9enoslLJKflx2USy2iPz1yGCWZrPzjLWmEMcx6j5e3fEUGF2p6p01w/zWxmiSoyJgBsby9P8Fl5nflsNMVR/or8frK4K1T6Y2oTuEx9aYymmBPFOO5DHaedDxnhZ04KKaACIECvKrT5V3PMM1jrE3qu6hJ1LS0/mSivEdCwCszHanjIQy/enkNtLgxVm4jIRUjuAwL1MmxPtkAUcKrQor1YokMqm5fExdwvnp+qjtyejfA3IvT93nYvCj4IEYNMDtUGFUBjsYLqg7Ked/jvO53Ek5WEAE/Mx8F/OAtuvkpEeUKTIWxfd+V0b7pgShVuU5zFyi3y97vpRtdwqzOFr8QT3Hq+g/RIdghPQ9pGQ3GOomTMO1B7mAyOG6SYyQM/wra2h2dQTHCbgzAtsPzZLiZhWIGcU7/mGLm0kZBT6McnH2//hsIPXG8S94u2MWE0KRH5YhJ/2ATWneYyFHWQfwqDeR/1CZe66gFcPJ9cOIG+8pcmXueLhnueDbh2EWa8jmumtrAz+z+rcokih0c7catT7pByDv24Ouuw2Yf3my60="
66 changes: 37 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,49 @@
ssh2-python
Redlibssh2
============

Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `libssh2`_.
Super fast SSH2 protocol library. ``redlibssh2`` provides Python bindings for `libssh2`_.

.. image:: https://img.shields.io/badge/License-LGPL%20v2-blue.svg
:target: https://pypi.python.org/pypi/ssh2-python
:target: https://pypi.python.org/pypi/redlibssh2
:alt: License
.. image:: https://img.shields.io/pypi/v/ssh2-python.svg
:target: https://pypi.python.org/pypi/ssh2-python
.. image:: https://img.shields.io/pypi/v/redlibssh2.svg
:target: https://pypi.python.org/pypi/redlibssh2
:alt: Latest Version
.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master
:target: https://travis-ci.org/ParallelSSH/ssh2-python
.. image:: https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python?svg=true&branch=master
:target: https://ci.appveyor.com/project/pkittenis/ssh2-python
.. image:: https://img.shields.io/pypi/wheel/ssh2-python.svg
:target: https://pypi.python.org/pypi/ssh2-python
.. image:: https://img.shields.io/pypi/pyversions/ssh2-python.svg
:target: https://pypi.python.org/pypi/ssh2-python
.. image:: https://readthedocs.org/projects/ssh2-python/badge/?version=latest
:target: http://ssh2-python.readthedocs.org/en/latest/
.. image:: https://travis-ci.org/Red-M/redlibssh2.svg?branch=master
:target: https://travis-ci.org/Red-M/redlibssh2
.. image:: https://img.shields.io/pypi/wheel/redlibssh2.svg
:target: https://pypi.python.org/pypi/redlibssh2
.. image:: https://img.shields.io/pypi/pyversions/redlibssh2.svg
:target: https://pypi.python.org/pypi/redlibssh2
.. image:: https://readthedocs.org/projects/redlibssh2/badge/?version=latest
:target: http://redlibssh2.readthedocs.org/en/latest/
:alt: Latest documentation


Installation
______________

Binary wheel packages are provided for Linux, OSX and Windows, all Python versions. Wheel packages have **no dependencies**.
Binary wheel packages are provided for Linux on all Python versions. Wheel packages have **no dependencies**.

``pip`` may need to be updated to be able to install binary wheel packages - ``pip install -U pip``.

.. code-block:: shell

pip install ssh2-python
pip install redlibssh2

`Conda <https://conda.io/miniconda.html>`_ is another installation option - see `documentation <http://ssh2-python.readthedocs.org/en/latest/>`_ for more detailed instructions.
For from source installation instructions, including building against system provided libssh2, `see documentation <https://redlibssh2.readthedocs.io/en/latest/installation.html#installation-from-source>`_.

For from source installation instructions, including building against system provided libssh2, `see documentation <https://ssh2-python.readthedocs.io/en/latest/installation.html#installation-from-source>`_.

For creating native system packages for Centos/RedHat, Ubuntu, Debian and Fedora, see `instructions in the documentation <http://ssh2-python.readthedocs.io/en/latest/installation.html#system-binary-packages>`_.
For creating native system packages for Centos/RedHat, Ubuntu, Debian and Fedora, see `instructions in the documentation <http://redlibssh2.readthedocs.io/en/latest/installation.html#system-binary-packages>`_.


API Feature Set
________________

At this time all of the `libssh2`_ API has been implemented up to version ``1.8.2``.
At this time all of the `libssh2`_ API has been implemented up to version ``1.9.0``.

Complete example scripts for various operations can be found in the `examples directory`_.

In addition, as ``ssh2-python`` is a thin wrapper of ``libssh2`` with Python semantics, `its code examples <https://libssh2.org/examples/>`_ can be ported straight over to Python with only minimal changes.
In addition, as ``redlibssh2`` is a thin wrapper of ``libssh2`` with Python semantics, `its code examples <https://libssh2.org/examples/>`_ can be ported straight over to Python with only minimal changes.


Library Features
Expand Down Expand Up @@ -159,7 +155,7 @@ Public Key Authentication
username, 'private_key_file')


Passphrase can be provided with the ``passphrase`` keyword param - see `API documentation <https://ssh2-python.readthedocs.io/en/latest/session.html#ssh2.session.Session.userauth_publickey_fromfile>`_.
Passphrase can be provided with the ``passphrase`` keyword param - see `API documentation <https://redlibssh2.readthedocs.io/en/latest/session.html#ssh2.session.Session.userauth_publickey_fromfile>`_.


Password Authentication
Expand Down Expand Up @@ -190,9 +186,9 @@ __________________

A simple usage example looks very similar to ``libssh2`` `usage examples <https://www.libssh2.org/examples/>`_.

See `examples directory <https://github.com/ParallelSSH/ssh2-python/tree/master/examples>`_ for more complete example scripts.
See `examples directory <https://github.com/Red-M/redlibssh2/tree/master/examples>`_ for more complete example scripts.

As mentioned, ``ssh2-python`` is intentionally a thin wrapper over ``libssh2`` and directly maps most of its API.
As mentioned, ``redlibssh2`` is intentionally a thin wrapper over ``libssh2`` and directly maps most of its API.

Clients using this library can be much simpler to use than interfacing with the ``libssh2`` API directly.

Expand Down Expand Up @@ -263,7 +259,7 @@ Performance of above example, compared with Paramiko.

:Output:

``ssh2-python``::
``redlibssh2``::

real 0m0.141s
user 0m0.037s
Expand All @@ -275,8 +271,20 @@ Performance of above example, compared with Paramiko.
user 0m0.351s
sys 0m0.021s

Why did you drop manylinux1 wheels?
___________________________________

Because frankly the manylinux1 docker containers won't run on my build hosts because I run up to date software and kernels.
The manylinux1 docker images are also full of extremely old package versions that will not receive updates or security fixes. The way that ParallelSSH handled this was to bundle their own versions of libssh2, OpenSSL and zlib in the repository.

Why did you drop Windows and OSX wheels?
________________________________________
I don't have build infrastructure for them and I don't use these platforms anywhere.
If someone would like these wheels to be built you can open an issue and it'll be reviewed based on what can be provided to get such builds running.



.. _libssh2: https://www.libssh2.org
.. _Cython: https://www.cython.org
.. _`examples directory`: https://github.com/ParallelSSH/ssh2-python/tree/master/examples
.. _`mail group`: https://groups.google.com/forum/#!forum/ssh2-python
.. _`examples directory`: https://github.com/Red-M/redlibssh2/tree/master/examples
.. _`mail group`: https://groups.google.com/forum/#!forum/redlibssh2
2 changes: 1 addition & 1 deletion ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ RUN mkdir -p build_libssh2 && cd build_libssh2 && \

RUN rm -rf ${OPENSSL}* build_libssh2 libssh2.tar.gz

VOLUME /var/cache
VOLUME /var/cache
18 changes: 18 additions & 0 deletions ci/docker/manylinux_2010/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#FROM quay.io/pypa/manylinux2014_x86_64
FROM quay.io/pypa/manylinux2010_x86_64

ENV SYSTEM_LIBSSH2 1

COPY ./libssh2 /libssh2

RUN yum -y --disablerepo="epel" install zlib-devel openssl-devel cmake gcc
RUN /opt/python/cp27-cp27m/bin/pip install enum
RUN /opt/python/cp27-cp27mu/bin/pip install enum

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake /libssh2 -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install

RUN rm -rf build_libssh2
8 changes: 8 additions & 0 deletions ci/gitlab/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

export DOCKER_TAG=red_m/redlibssh2
rm -rf build dist ssh2/libssh2.*

docker build -t $DOCKER_TAG ci/docker/manylinux_2010
docker run --rm -v `pwd`:/io $DOCKER_TAG /io/ci/gitlab/build-wheels.sh
ls wheelhouse/
17 changes: 17 additions & 0 deletions ci/gitlab/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -xe

# Compile wheels
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done

# Install packages and test
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
"${PYBIN}/pip" install redlibssh2 --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()')
done
6 changes: 3 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package:
version: {{ version }}

source:
git_url: https://github.com/ParallelSSH/ssh2-python.git
git_url: https://github.com/Red-M/Redlibssh2.git

build:
features:
Expand Down Expand Up @@ -39,7 +39,7 @@ test:
- ssh2.session

about:
home: http://github.com/ParallelSSH/ssh2-python
home: https://github.com/Red-M/Redlibssh2
license: LGPL-2.1
license_family: LGPL
license_file: LICENSE
Expand All @@ -51,7 +51,7 @@ about:
ssh2-python provides Python bindings for libssh2.

Its only dependency is the libssh2 library.
dev_url: https://github.com/ParallelSSH/ssh2-python
dev_url: https://github.com/Red-M/Redlibssh2

extra:
recipe-maintainers:
Expand Down
1 change: 1 addition & 0 deletions libssh2
Submodule libssh2 added at 42d37a
Loading