ronf / asyncssh

AsyncSSH is a Python package which provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python asyncio framework.
Eclipse Public License 2.0
1.51k stars 144 forks source link

.. image:: https://readthedocs.org/projects/asyncssh/badge/?version=latest :target: https://asyncssh.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/asyncssh.svg :target: https://pypi.python.org/pypi/asyncssh/ :alt: AsyncSSH PyPI Project

AsyncSSH: Asynchronous SSH for Python

AsyncSSH is a Python package which provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python 3.6+ asyncio framework.

.. code:: python

import asyncio, asyncssh, sys

async def run_client(): async with asyncssh.connect('localhost') as conn: result = await conn.run('echo "Hello!"', check=True) print(result.stdout, end='')

try: asyncio.get_event_loop().run_until_complete(run_client()) except (OSError, asyncssh.Error) as exc: sys.exit('SSH connection failed: ' + str(exc))

Check out the examples__ to get started!

__ http://asyncssh.readthedocs.io/en/stable/#client-examples

Features

http://asyncssh.readthedocs.io/en/stable/api.html#key-exchange-algorithms http://asyncssh.readthedocs.io/en/stable/api.html#encryption-algorithms http://asyncssh.readthedocs.io/en/stable/api.html#mac-algorithms http://asyncssh.readthedocs.io/en/stable/api.html#compression-algorithms http://asyncssh.readthedocs.io/en/stable/api.html#public-key-support http://asyncssh.readthedocs.io/en/stable/api.html#ssh-agent-support http://asyncssh.readthedocs.io/en/stable/api.html#known-hosts http://asyncssh.readthedocs.io/en/stable/api.html#authorized-keys __ http://asyncssh.readthedocs.io/en/stable/api.html#config-file-support

License

This package is released under the following terms:

Copyright (c) 2013-2022 by Ron Frederick ronf@timeheart.net and others.

This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution and is available at:

http://www.eclipse.org/legal/epl-2.0/

This program may also be made available under the following secondary licenses when the conditions for such availability set forth in the Eclipse Public License v2.0 are satisfied:

 GNU General Public License, Version 2.0, or any later versions of
 that license

SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later

For more information about this license, please see the Eclipse Public License FAQ <https://www.eclipse.org/legal/epl-2.0/faq.php>_.

Prerequisites

To use AsyncSSH 2.0 or later, you need the following:

Installation

Install AsyncSSH by running:

::

pip install asyncssh

Optional Extras ^^^^^^^^^^^^^^^

There are some optional modules you can install to enable additional functionality:

AsyncSSH defines the following optional PyPI extra packages to make it easy to install any or all of these dependencies:

| bcrypt | fido2 | gssapi | libnacl | pkcs11 | pyOpenSSL | pywin32

For example, to install bcrypt, fido2, gssapi, libnacl, pkcs11, and pyOpenSSL on UNIX, you can run:

::

pip install 'asyncssh[bcrypt,fido2,gssapi,libnacl,pkcs11,pyOpenSSL]'

To install bcrypt, fido2, libnacl, pkcs11, pyOpenSSL, and pywin32 on Windows, you can run:

::

pip install 'asyncssh[bcrypt,fido2,libnacl,pkcs11,pyOpenSSL,pywin32]'

Note that you will still need to manually install the libsodium library listed above for libnacl to work correctly and/or libnettle for UMAC support. Unfortunately, since liboqs, libsodium, and libnettle are not Python packages, they cannot be directly installed using pip.

Installing the development branch ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you would like to install the development branch of asyncssh directly from Github, you can use the following command to do this:

::

  pip install git+https://github.com/ronf/asyncssh@develop

Mailing Lists

Three mailing lists are available for AsyncSSH:

http://groups.google.com/d/forum/asyncssh-announce http://groups.google.com/d/forum/asyncssh-dev __ http://groups.google.com/d/forum/asyncssh-users