Package: asyncssh
AsyncSSH: Asynchronous SSH for PythonAsyncSSH 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.importasyncio,asyncssh,sysasyncdefrun_client():asyncwithasyncssh.connect('localhost')asconn:result=awaitconn.run('echo "Hello!"',check=True)print(result.stdout,end='')try:asyncio.get_event_loop().run_until_complete(run_client())except(OSError,asyncssh.Error)asexc:sys.exit('SSH connection failed: '+str(exc))Check out theexamplesto get started!FeaturesFull support for SSHv2, SFTP, and SCP client and server functionsShell, command, and subsystem channelsEnvironment variables, terminal type, and window sizeDirect and forwarded TCP/IP channelsOpenSSH-compatible direct and forwarded UNIX domain socket channelsLocal and remote TCP/IP port forwardingLocal and remote UNIX domain socket forwardingDynamic TCP/IP port forwarding via SOCKSX11 forwarding support on both the client and the serverSFTP protocol version 3 with OpenSSH extensionsExperimental support for SFTP versions 4-6, when requestedSCP protocol support, including third-party remote to remote copiesMultiple simultaneous sessions on a single SSH connectionMultiple SSH connections in a single event loopByte and string based I/O with settable encodingA variety ofkey exchange,encryption, andMACalgorithmsIncluding OpenSSH post-quantum kex algorithm
sntrup761x25519-sha512@openssh.comSupport forgzip compressionIncluding OpenSSH variant to delay compression until after authUser and host-based public key, password, and keyboard-interactive
authentication methodsMany types and formats ofpublic keys and certificatesIncluding OpenSSH-compatible support for U2F and FIDO2 security keysIncluding PKCS#11 support for accessing PIV security tokensIncluding support for X.509 certificates as defined in RFC 6187Support for accessing keys managed byssh-agenton UNIX systemsIncluding agent forwarding support on both the client and the serverSupport for accessing keys managed by PuTTY’s Pageant agent on WindowsSupport for accessing host keys via OpenSSH’s ssh-keysignOpenSSH-styleknown_hosts filesupportOpenSSH-styleauthorized_keys filesupportPartial support forOpenSSH-style configuration filesCompatibility with OpenSSH “Encrypt then MAC” option for better securityTime and byte-count based session key renegotiationDesigned to be easy to extend to support new forms of key exchange,
authentication, encryption, and compression algorithmsLicenseThis 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 licenseSPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-laterFor more information about this license, please see theEclipse
Public License FAQ.PrerequisitesTo use AsyncSSH 2.0 or later, you need the following:Python 3.6 or latercryptography (PyCA) 3.1 or laterInstallationInstall AsyncSSH by running:pip install asyncsshOptional ExtrasThere are some optional modules you can install to enable additional
functionality:Install bcrypt fromhttps://pypi.python.org/pypi/bcryptif you want support for OpenSSH private key encryption.Install fido2 fromhttps://pypi.org/project/fido2if you want support
for key exchange and authentication with U2F/FIDO2 security keys.Install python-pkcs11 fromhttps://pypi.org/project/python-pkcs11if
you want support for accessing PIV keys on PKCS#11 security tokens.Install gssapi fromhttps://pypi.python.org/pypi/gssapiif you
want support for GSSAPI key exchange and authentication on UNIX.Install liboqs fromhttps://github.com/open-quantum-safe/liboqsif you want support for the OpenSSH post-quantum key exchange
algorithm sntrup761x25519-sha512@openssh.com.Install libsodium fromhttps://github.com/jedisct1/libsodiumand libnacl fromhttps://pypi.python.org/pypi/libnaclif you have
a version of OpenSSL older than 1.1.1b installed and you want
support for Curve25519 key exchange, Ed25519 keys and certificates,
or the Chacha20-Poly1305 cipher.Install libnettle fromhttp://www.lysator.liu.se/~nisse/nettle/if you want support for UMAC cryptographic hashes.Install pyOpenSSL fromhttps://pypi.python.org/pypi/pyOpenSSLif you want support for X.509 certificate authentication.Install pywin32 fromhttps://pypi.python.org/pypi/pywin32if you
want support for using the Pageant agent or support for GSSAPI
key exchange and authentication on Windows.AsyncSSH defines the following optional PyPI extra packages to make it
easy to install any or all of these dependencies:bcryptfido2gssapilibnaclpkcs11pyOpenSSLpywin32For 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 branchIf 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@developMailing ListsThree mailing lists are available for AsyncSSH:asyncssh-announce@googlegroups.com: Project announcementsasyncssh-dev@googlegroups.com: Development discussionsasyncssh-users@googlegroups.com: End-user discussions