High-performance SSH2 implementation with modern cryptography. SFTP, SCP, port forwarding, and interactive shells - all with zero-compromise security.
Trusted by engineering teams at
Features
A complete SSH2 implementation with modern async/await patterns, designed for performance and developer experience.
ChaCha20-Poly1305, AES-GCM, Ed25519, ECDSA. No deprecated algorithms - we've eliminated MD5, SHA1, DES, and 3DES entirely.
Full-featured secure file transfer with streaming support, progress callbacks, and automatic resume capabilities.
Local and remote port forwarding with connection pooling. Tunnel any TCP traffic securely through SSH.
Full PTY support for interactive terminal sessions. Perfect for building SSH clients and automation tools.
Optimized for low latency and high throughput. Full async/await with ValueTask for zero-allocation hot paths.
Works seamlessly on Windows, Linux, and macOS. Supports .NET 8, .NET 6, and .NET Standard 2.1.
Security First
Modern cryptography with no compromises. We've eliminated every deprecated algorithm.
We've completely removed MD5, SHA1, DES, and 3DES from our codebase. Only modern, battle-tested cryptographic primitives are used.
Credentials are stored in secure memory regions and zeroed immediately after use. No plaintext passwords in memory dumps or crash logs.
Support for curve25519-sha256, ecdh-sha2-nistp256/384/521, and diffie-hellman-group16/18-sha512 key exchange algorithms.
Active maintenance with prompt security patches and vulnerability fixes. Enterprise customers receive priority advisory notifications.
Examples
Get started in minutes with our intuitive API. Here are real-world examples you can copy and use today.
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}");
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");
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");
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
Download
Choose how you want to get started with the library.
For Existing Customers
Already have a license? Download the latest version directly. Your existing license key will work with this release.
Download NowVersion 1.2.8 · 2.4 MB
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
Pricing
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.
Team
$299 one-time
Includes 2 years of updates
For teams building production applications.
Enterprise
$749 one-time
Includes 2 years of updates
For organizations requiring unlimited scale.
Try TWSSH free for 30 days. Full Team features, no credit card required.