Skip to content
pubscout

dartssh2

4.1.0, released 3 months ago by victorcarreras.dev

SSH and SFTP client written in pure Dart

WASM-ready
$ flutter pub add dartssh2
Source repository

What it does

Provides an SSH and SFTP client library implemented in pure Dart that supports running remote commands, interactive shells, port forwarding, authentication methods, and file transfers across multiple platforms including the web.

AI-written summary of version 4.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to connect to remote servers via SSH or execute commands programmatically from a Dart or Flutter application.
  • You require an SFTP client to upload, download, and manage remote files.
  • You need a pure Dart SSH implementation that works across mobile, desktop, and web platforms.

Skip it when

  • You are running in a browser environment where direct TCP sockets are not available and you have not supplied a WebSocket-to-TCP proxy or alternative transport.
  • You need an SSH server implementation rather than a client.

Strengths

  • Written in pure Dart with support for mobile, desktop, and web environments.
  • Supports SSH sessions, key authentication, port forwarding, and SFTPv3 operations.
  • Offloads heavy key exchange calculations to background isolates on supported VM platforms.

Weaknesses

  • Requires custom transport configuration (like WebSockets) when used on Flutter Web since direct TCP sockets are unavailable.
  • Some platform-specific cipher limitations exist in browser targets (e.g., Poly1305).

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5

No special build runner or native SDK dependencies required; for web usage, a WebSocket bridge transport must be implemented.

void main() async {
  final client = SSHClient(
    await SSHSocket.connect('localhost', 22),
    username: '<username>',
    onPasswordRequest: () => '<password>',
  );
}

Alternatives

Packages that do the same job and could replace dartssh2.

  • http2

    An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.

  • nm

    Client for interacting with Linux NetworkManager via D-Bus

  • graphql_flutter

    A GraphQL client for Flutter with widget wrappers and hooks.

  • graphql

    A Dart GraphQL client offering queries, mutations, subscriptions and cache management.

Works with

Packages commonly used together with dartssh2: ones it builds on, ones built on it, and its own family.