v1.2.8 Now Available

Enterprise-Grade
SSH Library
for .NET

High-performance SSH2 implementation with modern cryptography. SFTP, SCP, port forwarding, and interactive shells - all with zero-compromise security.

Download SDK

Trusted by engineering teams at

Everything you need for secure connections

A complete SSH2 implementation with modern async/await patterns, designed for performance and developer experience.

Modern Cryptography

ChaCha20-Poly1305, AES-GCM, Ed25519, ECDSA. No deprecated algorithms - we've eliminated MD5, SHA1, DES, and 3DES entirely.

SFTP & SCP Support

Full-featured secure file transfer with streaming support, progress callbacks, and automatic resume capabilities.

Port Forwarding

Local and remote port forwarding with connection pooling. Tunnel any TCP traffic securely through SSH.

Interactive Shell

Full PTY support for interactive terminal sessions. Perfect for building SSH clients and automation tools.

High Performance

Optimized for low latency and high throughput. Full async/await with ValueTask for zero-allocation hot paths.

Cross-Platform

Works seamlessly on Windows, Linux, and macOS. Supports .NET 8, .NET 6, and .NET Standard 2.1.

Built for zero-trust environments

Modern cryptography with no compromises. We've eliminated every deprecated algorithm.

ChaCha20-Poly1305
AES-256-GCM
Ed25519
ECDSA P-256/384/521
Curve25519
SHA-512

No Deprecated Algorithms

We've completely removed MD5, SHA1, DES, and 3DES from our codebase. Only modern, battle-tested cryptographic primitives are used.

Secure Memory Handling

Credentials are stored in secure memory regions and zeroed immediately after use. No plaintext passwords in memory dumps or crash logs.

Latest Key Exchange

Support for curve25519-sha256, ecdh-sha2-nistp256/384/521, and diffie-hellman-group16/18-sha512 key exchange algorithms.

Regular Security Updates

Active maintenance with prompt security patches and vulnerability fixes. Enterprise customers receive priority advisory notifications.

Simple API, powerful results

Get started in minutes with our intuitive API. Here are real-world examples you can copy and use today.

BasicConnection.cs
using TwSsh.Client;
using TwSsh.Licensing;

// Initialize license (required for production)
LicenseManager.Instance.Initialize("YOUR-LICENSE-KEY");

// Configure connection settings
var settings = new SshClientSettings
{
    Host = "your-server.com",
    Port = 22,
    Credential = new PasswordCredential("username", "password")
};

// Connect and execute commands
await using var client = new SshClient(settings);
await client.ConnectAndAuthenticateAsync();

var result = await client.RunCommandAsync("df -h");
Console.WriteLine(result.Output);
Console.WriteLine($"Exit code: {result.ExitCode}");
SftpTransfer.cs
using TwSsh.Client;
using TwSsh.Sftp;

await using var client = new SshClient(settings);
await client.ConnectAndAuthenticateAsync();

// Create SFTP client
await using var sftp = await SftpClient.ConnectAsync(client);

// Upload with progress
var progress = new Progress<SftpTransferProgress>(p =>
    Console.WriteLine($"{p.PercentComplete:F1}% complete"));

await sftp.UploadFileAsync("backup.zip", "/remote/backup.zip",
    new SftpTransferOptions(), progress);

// List directory
var files = await sftp.ListDirectoryAsync("/home/user");
foreach (var file in files)
    Console.WriteLine($"{file.FileName} - {file.Attributes.Size} bytes");
InteractiveShell.cs
using TwSsh.Client;
using TwSsh.Connection;

await using var client = new SshClient(settings);
await client.ConnectAndAuthenticateAsync();

// Create interactive shell with PTY
await using var shell = await client.CreateShellAsync(new PtyRequest
{
    TerminalType = "xterm-256color",
    Columns = 120,
    Rows = 40
});

// Send commands
await shell.WriteLineAsync("top -n 1");

// Read output using Stream API
var buffer = new byte[4096];
var bytesRead = await shell.ReadAsync(buffer);
Console.Write(Encoding.UTF8.GetString(buffer, 0, bytesRead));

// Or use the convenient Expect method
var output = shell.Expect("$", TimeSpan.FromSeconds(5));
await shell.WriteLineAsync("exit");
PortForwarding.cs
using TwSsh.Client;

await using var client = new SshClient(settings);
await client.ConnectAndAuthenticateAsync();

// Forward local port 5432 to remote PostgreSQL
var tunnel = await client.ForwardLocalPortAsync(
    localHost: "127.0.0.1",
    localPort: 5432,
    remoteHost: "db.internal",
    remotePort: 5432
);

Console.WriteLine("Tunnel active. Connect to localhost:5432");

// Keep tunnel open until cancelled
await Task.Delay(Timeout.Infinite, cancellationToken);

// Tunnel automatically closes when client is disposed

Get TWSSH Now

Choose how you want to get started with the library.

Instant Download

For Existing Customers

Already have a license? Download the latest version directly. Your existing license key will work with this release.

Download Now

Version 1.2.8 · 2.4 MB

Free Trial

30 Days Full Access

New to TWSSH? Get a free 30-day trial license with all Team features. No credit card required.

Includes download · License via email

Choose your plan

Start with a 30-day free trial. No credit card required.

Developer

$99 one-time

Includes 2 years of updates

Perfect for individual developers and small projects.

  • Up to 5 concurrent connections
  • SSH & command execution
  • Interactive shell
  • SFTP file transfer
  • SCP file transfer
  • Public key authentication
  • Port forwarding
  • Advanced crypto (ChaCha20)

Enterprise

$749 one-time

Includes 2 years of updates

For organizations requiring unlimited scale.

  • Unlimited connections
  • Everything in Team
  • Priority support (4hr SLA)
  • Dedicated account manager
  • Security advisory notifications
  • Custom integration support
  • Volume licensing available

Ready to get started?

Try TWSSH free for 30 days. Full Team features, no credit card required.

Read Documentation