Skip to main content

AsyncSSH: Asynchronous SSHv2 client and server library

Project description

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

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!

Features

  • Full support for SSHv2 and SFTP client and server functions

    • Shell, command, and subsystem channels

    • Environment variables, terminal type, and window size

    • Direct and forwarded TCP/IP channels

    • OpenSSH-compatible direct and forwarded UNIX domain socket channels

    • Local and remote TCP/IP port forwarding

    • Local and remote UNIX domain socket forwarding

    • SFTP protocol version 3 with OpenSSH extensions

  • Multiple simultaneous sessions on a single SSH connection

  • Multiple SSH connections in a single event loop

  • Byte and string based I/O with settable encoding

  • A variety of key exchange, encryption, and MAC algorithms

  • Support for gzip compression

    • Including OpenSSH variant to delay compression until after auth

  • Password, public key, and keyboard-interactive user authentication methods

  • Many types and formats of public keys and certificates

  • Support for accessing keys managed by ssh-agent

  • OpenSSH-style ssh-agent forwarding support

  • OpenSSH-style known_hosts file support

  • OpenSSH-style authorized_keys file support

  • Compatibility with OpenSSH “Encrypt then MAC” option for better security

  • Time and byte-count based session key renegotiation

  • Designed to be easy to extend to support new forms of key exchange, authentication, encryption, and compression algorithms

License

This package is released under the following terms:

Copyright (c) 2013-2016 by Ron Frederick <ronf@timeheart.net>. All rights reserved.

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

http://www.eclipse.org/legal/epl-v10.html

For more information about this license, please see the Eclipse Public License FAQ.

Prerequisites

To use asyncssh, you need the following:

  • Python 3.4 or later

  • cryptography (PyCA) 1.1 or later

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
libnacl

For example, to install both of these, you can run:

pip install 'asyncssh[bcrypt,libnacl]'

Note that you will still need to manually install the libsodium library listed above for libnacl to work correctly. Unfortunately, since libsodium is not a Python package, it 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:

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

asyncssh-1.7.2.tar.gz (219.4 kB view details)

Uploaded Source

Built Distribution

asyncssh-1.7.2-py3.5.egg (442.2 kB view details)

Uploaded Egg

File details

Details for the file asyncssh-1.7.2.tar.gz.

File metadata

  • Download URL: asyncssh-1.7.2.tar.gz
  • Upload date:
  • Size: 219.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asyncssh-1.7.2.tar.gz
Algorithm Hash digest
SHA256 758b176f9f0bf9ebd94e0b79596674283a3ac79a673a0c5e204a47162538323d
MD5 32dcd8b017355dd35f3535bf11fb696a
BLAKE2b-256 7705f0287a21cbc2db0b3966ce6920c79887d8de365e4782d287007278e10170

See more details on using hashes here.

File details

Details for the file asyncssh-1.7.2-py3.5.egg.

File metadata

File hashes

Hashes for asyncssh-1.7.2-py3.5.egg
Algorithm Hash digest
SHA256 4b2cb8c90adc1faac309b91e6d892e61bbd6e28a17536a271fc0d1349e7f4220
MD5 2771d57d7511038beb54df908f81a727
BLAKE2b-256 c7427a291653b305c5830909dfb53c7d3b17b7971c611d56284dabdd29268d77

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page