Skip to content

Commit

Permalink
Added id_ecdsa to default identities list for native client. Updated …
Browse files Browse the repository at this point in the history
…changelog.

Disable python 3.7 win32 builds due to gevent build failure on that platform and architecture
Updated travis cfg
Updated documentation, readme
Updated travis osx script.
  • Loading branch information
pkittenis committed Oct 23, 2018
1 parent e290bd7 commit 5f4a413
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 63 deletions.
11 changes: 6 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ environment:
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86

- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 14"
ARCH: i386
# No gevent 3.7 32-bit wheel available, source build fails.
# - PYTHON: "C:\\Python37"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "32"
# MSVC: "Visual Studio 14"
# ARCH: i386

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7"
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ before_install:
install:
- pip install -r requirements_dev.txt
script:
- export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu
# For testing SSH agent related functionality
- eval `ssh-agent -s`
- nosetests --with-coverage --cover-package=pssh tests/test_native_tunnel.py
- nosetests --with-coverage --cover-package=pssh --nologcapture tests/test_native_tunnel.py
- nosetests --with-coverage --cover-package=pssh tests/test_native_*_client.py
- nosetests --with-coverage --cover-package=pssh tests/test_paramiko*.py
- flake8 pssh
Expand Down
5 changes: 3 additions & 2 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Change Log
Changes
--------

* Removed libssh2 native library dependency in favour of bundled ssh2-python libssh2 library.
* Removed libssh2 native library dependency in favour of bundled ``ssh2-python`` libssh2 library.
* Changed native client forward agent default behaviour to off due to incompatibility with certain SSH server implementations.
* Added keep-alive functionality to native client - defaults to ``60`` seconds. ``ParallelSSHClient.keepalive_seconds`` to configure interval, ``0`` to disable.
* Added keep-alive functionality to native client - defaults to ``60`` seconds. ``ParallelSSHClient(<..>, keepalive_seconds=<interval>)`` to configure interval, Set to ``0`` to disable.
* Added ``~/.ssh/id_ecdsa`` default identity location to native client.


1.8.2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ The default SSH client library in ``parallel-ssh`` ``1.x.x`` series.

Pure Python code, while having native extensions as dependencies, with poor performance and numerous bugs compared to both OpenSSH binaries and the ``libssh2`` based native clients in ``parallel-ssh`` ``1.2.x`` and above. Recent versions have regressed in performance and have `blocker issues <https://github.com/ParallelSSH/parallel-ssh/issues/83>`_.

It does not support non-blocking mode, so to make it non-blocking monkey patching must be used which affects all other uses of the Python standard library. However, some functionality like Kerberos (GSS-API) authentication is not provided by other libraries.
It does not support non-blocking mode, so to make it non-blocking monkey patching must be used which affects all other uses of the Python standard library. However, some functionality like Kerberos (GSS-API) authentication is not currently provided by other libraries.

asyncssh
________
Expand Down
2 changes: 0 additions & 2 deletions ci/travis/pyenv-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ python -m pip install -U setuptools pip
pip install -U delocate wheel
pip install -r requirements.txt
pip wheel --no-deps .
cp /usr/local/lib/libssh2* .
delocate-listdeps --all *.whl
delocate-wheel -v *.whl
delocate-listdeps --all *.whl

ls -l *.whl
rm -f *.dylib
pip install -v *.whl
pwd; mkdir -p temp; cd temp; pwd
python -c "import pssh.clients" && echo "Import successfull"
Expand Down
60 changes: 33 additions & 27 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,20 @@ Pip Install
If ``pip`` is not available on your Python platform, `see this installation guide <http://docs.python-guide.org/en/latest/starting/installation/>`_.

Old Python Versions
---------------------

``1.1.x`` and above releases are not guaranteed to be compatible with Python ``2.6``.

If you are running a deprecated Python version such as ``2.6`` you may need to install an older version of ``parallel-ssh`` that is compatible with that Python platform.

For example, to install the ``1.0.0`` version, run the following.

.. code-block:: shell
pip install parallel-ssh==1.0.0
``1.0.0`` is compatible with all Python versions over or equal to ``2.6``, including all of the ``3.x`` series.

Older versions such as `0.70.x` are compatible with Python ``2.5`` and ``2.x`` but not the ``3.x`` series.

Dependencies
--------------

When installing from source, it is responsibility of user to satisfy dependencies. For pre-built binary wheel packages with dependencies included, see `Pip Install`_.
When installing from source, dependencies must be satisfied by ``pip install -r requirements.txt``. For pre-built binary wheel packages with dependencies included, see `Pip Install`_.

============ ================
Dependency Minimum Version
============ ================
``libssh2`` ``1.6``
``gevent`` ``1.1``
``paramiko`` ``1.15.3``
============ ================
From ``2.0.0`` onwards, paramiko will become an _optional_ extra, with ``libssh2``, and for a limited set of functionality, ``libssh`` native library based clients via ``ssh2-python`` and ``ssh-python`` bindings respectively replacing it.

=============== ================
Dependency Minimum Version
=============== ================
``ssh2-python`` ``0.16.0``
``gevent`` ``1.1``
``paramiko`` ``1.15.3``
=============== ================


Building from Source
Expand Down Expand Up @@ -106,7 +91,7 @@ Debian based

.. code-block:: shell
docker build --cache-from parallelssh/ssh2-python:debian7 ci/docker/debian7 -t debian7
docker build --cache-from parallelssh/parallel-ssh-pkgs:debian7 ci/docker/debian7 -t debian7
docker run -v "$(pwd):/src/" debian7 --iteration debian7 -s python -t deb setup.py
Expand All @@ -115,5 +100,26 @@ RPM based

.. code-block:: shell
docker build --cache-from parallelssh/ssh2-python:centos7 ci/docker/centos7 -t centos7
docker build --cache-from parallelssh/parallel-ssh-pkgs:centos7 ci/docker/centos7 -t centos7
docker run -v "$(pwd):/src/" centos7 --rpm-dist el7 -s python -t rpm setup.py
See `fpm <http://fpm.readthedocs.io/en/latest/>`_ for making system packages of various types.


Deprecated Python Versions
---------------------------

``1.1.x`` and above releases are not compatible with Python ``2.6``.

If you are running a deprecated Python version such as ``2.6`` you may need to install an older version of ``parallel-ssh`` that is compatible with that Python platform.

For example, to install the ``1.0.0`` version, run the following.

.. code-block:: shell
pip install parallel-ssh==1.0.0
``1.0.0`` is compatible with all Python versions over or equal to ``2.6``, including all of the ``3.x`` series.

Older versions such as `0.70.x` are compatible with Python ``2.5`` and ``2.x`` but not the ``3.x`` series.
39 changes: 20 additions & 19 deletions doc/ssh2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ For the ``ssh2-python`` (``libssh2``) based clients, not all features supported

Below is a comparison of feature support for the two client types.

=============================== ============== ======================
Feature paramiko ssh2-python (libssh2)
=============================== ============== ======================
Agent forwarding Yes Yes (binary wheels or from source builds only)
Proxying/tunnelling Yes Yes
Kerberos (GSS) authentication Yes Not supported
Private key file authentication Yes Yes
Private key from memory Yes Not yet implemented
Agent authentication Yes Yes
Password authentication Yes Yes
SFTP copy to/from hosts Yes Yes
Session timeout setting Yes Yes
Per-channel timeout setting Yes Yes
Programmatic SSH agent Yes Not supported
OpenSSH config parsing Yes Not yet implemented
ECSA keys support Yes Yes
SCP functionality Not supported Yes
=============================== ============== ======================
=============================== ============== ====================== ===============================================================================
Feature paramiko ssh2-python (libssh2) Notes
=============================== ============== ====================== ===============================================================================
Agent forwarding Yes Yes From source builds only - cython and embedded ssh2 required
Proxying/tunnelling Yes Yes Current implementation has low performance - establishes connections serially
Kerberos (GSS) authentication Yes Not supported
Private key file authentication Yes Yes ECDSA supported, ED25519 pending upstream update
Private key from memory Yes Not yet implemented
Agent authentication Yes Yes
Password authentication Yes Yes
SFTP copy to/from hosts Yes Yes
Session timeout setting Yes Yes
Per-channel timeout setting Yes Yes
Programmatic SSH agent Yes Not supported
OpenSSH config parsing Yes Not yet implemented
ECSA keys support Yes Yes
SCP functionality Not supported Yes
Keep-alive functionality Unknown Yes As of ``1.9.0``
=============================== =============== ====================== ==============================================================================

If any of missing features are required for a use case, then the paramiko based clients should be used instead.
If any of missing features are required for a use case, then the paramiko based clients should be used instead. Note there are several breaking bugs and low performance in some paramiko functionality, mileage may vary.

In all other cases the ``ssh2-python`` based clients offer significantly greater performance at less overhead and are preferred.
11 changes: 6 additions & 5 deletions pssh/clients/native/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@
class SSHClient(object):
"""ssh2-python (libssh2) based non-blocking SSH client."""

IDENTITIES = [
IDENTITIES = (
os.path.expanduser('~/.ssh/id_rsa'),
os.path.expanduser('~/.ssh/id_dsa'),
os.path.expanduser('~/.ssh/identity')
]
os.path.expanduser('~/.ssh/identity'),
os.path.expanduser('~/.ssh/id_ecdsa'),
)

def __init__(self, host,
user=None, password=None, port=None,
Expand Down Expand Up @@ -122,11 +123,11 @@ def __init__(self, host,
self.forward_ssh_agent = forward_ssh_agent
self._forward_requested = False
self.session = None
self.keepalive_seconds = keepalive_seconds
self._keepalive_greenlet = None
self._host = proxy_host if proxy_host else host
self.pkey = _validate_pkey_path(pkey, self.host)
self._connect(self._host, self.port)
self.keepalive_seconds = keepalive_seconds
self._keepalive_greenlet = None
if _auth_thread_pool:
THREAD_POOL.apply(self._init)
else:
Expand Down

0 comments on commit 5f4a413

Please sign in to comment.