asyncssh
AsyncSSH: Asynchronous SSHv2 client and server library
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 asyncsshuv
uv add asyncsshpoetry
poetry add asyncsshInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
parallel-sshAsynchronous SSH client for running commands on…
copyleft · top 15,000 on PyPI
sshfsProvides an fsspec-compatible filesystem…
permissive · top 5,000 on PyPI
sshpubkeysParses and validates OpenSSH public keys,…
permissive · top 5,000 on PyPI
scpProvides file transfer over SSH using the SCP…
copyleft · top 5,000 on PyPI
fs.sshfsfs.sshfs provides a PyFilesystem2 interface to…
copyleft · top 15,000 on PyPI
sftprettyA Python3 wrapper around paramiko that…
permissive · top 15,000 on PyPI
sshuttlesshuttle creates a transparent proxy that…
copyleft · top 15,000 on PyPI
mock-ssh-serverProvides a Python context manager that runs an…
permissive · top 15,000 on PyPI
paramikoParamiko is a pure-Python SSH protocol library…
copyleft · top 1,000 on PyPI
pproxypproxy is an asynchronous proxy server that…
permissive · top 15,000 on PyPI