skillfed

asyncssh

AsyncSSH: Asynchronous SSHv2 client and server library

asyncssh v2.24.0 19.4M downloads/30d#1,066 on PyPI1,751
Copyleft license EPL-2.0 OR GPL-2.0-or-later Active released

What it is and what it does

AsyncSSH is a production-grade SSH protocol library built on Python's asyncio framework. It implements both client and server sides of SSHv2, SFTP, and SCP, allowing you to run remote commands, transfer files, forward ports, and manage SSH tunnels asynchronously within a single event loop. The package handles key exchange, multiple authentication methods (public key, password, keyboard-interactive), and session management, with support for modern algorithms including post-quantum key exchange (ML-KEM, SNTRUP).

The library is designed for developers who need SSH functionality in async Python applications—whether building automation tools, remote administration systems, or integrating SSH into larger async services. It depends only on cryptography and typing_extensions at runtime, with optional extras for enhanced features like FIDO2 security keys, PKCS#11 tokens, and GSSAPI authentication. The codebase is actively maintained, supports Python 3.10 through 3.14, and carries no known vulnerabilities.

Use it for:

  • Automate remote command execution and file transfers in async Python applications without blocking the event loop.
  • Build SSH-based tunneling and port-forwarding services that handle multiple concurrent connections efficiently.
  • Implement custom SSH servers for embedded systems, IoT devices, or specialized remote-access protocols.
  • Integrate SSH key management and authentication into larger async frameworks or microservices.
  • Execute batch operations across multiple remote hosts concurrently using a single asyncio event loop.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

AsyncSSH provides an asynchronous SSH client and server implementation for Python 3.10+, supporting SSHv2, SFTP, and SCP protocols with full key exchange, authentication, and channel management.

Yes. AsyncSSH is a mature, actively maintained library with low install friction, no known vulnerabilities, and strong support for modern Python versions. The copyleft license (EPL-2.0 or GPL-2.0-or-later) requires attention if you plan to distribute proprietary software, but poses no barrier for internal or open-source use. Install it if you need async SSH functionality in Python.

Install

asyncssh on PyPI

pip

pip install asyncssh

uv

uv add asyncssh

poetry

poetry add asyncssh

Installing asyncssh

Before you install

Low install friction with only two runtime dependencies (cryptography and typing_extensions). Active maintenance with a recent release 48 days ago and ongoing repository activity. Supports current Python versions (3.10–3.14).

License in practice

Dual-licensed under EPL-2.0 or GPL-2.0-or-later (copyleft). Users must comply with one of these licenses; GPL-2.0-or-later imposes source-code distribution obligations if the package is distributed as part of a larger work.

Quickstart

pip install asyncssh

import asyncio
import asyncssh

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

asyncio.run(run_client())

Requires Python 3.10 or later and cryptography 39.0 or later. Optional features (U2F/FIDO2, PKCS#11, GSSAPI, post-quantum algorithms) require additional system libraries or Python packages.

Verify before relying

  • Performance characteristics under high concurrency or large file transfers
  • Compatibility with specific SSH server implementations beyond OpenSSH
  • Security audit status or third-party security review history

Package facts

License EPL-2.0 OR GPL-2.0-or-later (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — cryptography, typing_extensions
Maintenance actively maintained — 48 days since the last release
Last repo commit
First released
Downloads 19,391,101/month — #1,066 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: asyncssh-2.24.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: InternetTopic :: Security :: CryptographyTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Networking

Tags

async ssh client serverasyncio ssh protocolsftp python asyncssh tunneling forwardingremote command executionscp file transferssh key authentication
async-iossh-protocolcryptography

More Python Modules packages