# sshnet/ssh.net

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sshnet-ssh-net).**

4,310 stars · 972 forks · C# · mit

## Links

- GitHub: https://github.com/sshnet/SSH.NET
- Homepage: http://sshnet.github.io/SSH.NET/
- awesome-repositories: https://awesome-repositories.com/repository/sshnet-ssh-net.md

## Topics

`network` `scp` `sftp` `ssh`

## Description

SSH.NET is a .NET library that implements the SSH-2 protocol for encrypted remote connections and secure file transfers. It provides a complete SSH-2 protocol stack implementation with a channel multiplexing engine that manages multiple concurrent channels over a single connection, supporting simultaneous shell sessions, remote command execution, SFTP transfers, and port forwarding tunnels. The library includes a pluggable authentication pipeline supporting password, public key, certificate, keyboard-interactive, and multi-factor authentication combinations.

The library distinguishes itself through its comprehensive file transfer capabilities, offering both SFTP and SCP protocols with stream-based file access patterns that integrate with standard .NET I/O patterns. It includes a port forwarding tunnel manager for creating local, remote, and dynamic port forwarding tunnels with lifecycle events and configurable timeout handling. SSH.NET also supports NETCONF device management over SSH, proxy connections through SOCKS4, SOCKS5, and HTTP proxies, and provides event-driven protocol message dispatching for extensible message processing.

The library covers the full range of SSH operations including remote command execution with background execution and stream-based input, interactive shell sessions with terminal resizing and output pattern matching, and comprehensive file management through SFTP including directory synchronization, permission changes, and metadata queries. It includes key generation for ECDSA, ED25519, and RSA key pairs, private key loading and decryption in multiple formats, and OpenSSH certificate parsing. Session management features include keep-alive signals, configurable timeouts, retry logic for channel creation, and resource limit controls.

The library is available as a set of client libraries covering SSH authentication, SFTP, SCP, port forwarding, and NETCONF operations, with internal logging support for troubleshooting connections.

## Tags

### Security & Cryptography

- [SSH-2 Protocol Implementations](https://awesome-repositories.com/f/security-cryptography/ssh-2-protocol-implementations.md) — Implements the full SSH-2 protocol stack for encrypted remote connections and secure file transfers.
- [Cryptographic Key Authentication](https://awesome-repositories.com/f/security-cryptography/authentication-clients/client-to-server-authentication/cryptographic-key-authentication.md) — Implements cryptographic key authentication for SSH sessions without passwords. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.html))
- [Interactive Prompt Handlers](https://awesome-repositories.com/f/security-cryptography/authentication-clients/client-to-server-authentication/interactive-prompt-handlers.md) — Prompts the user for responses to server-issued challenges during an interactive SSH login sequence. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.KeyboardInteractiveAuthenticationMethod.html))
- [Diffie-Hellman Exchanges](https://awesome-repositories.com/f/security-cryptography/key-exchange-protocols/diffie-hellman-exchanges.md) — Establishes a shared secret between client and server using the Diffie-Hellman algorithm. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Security.html))
- [Group Exchanges](https://awesome-repositories.com/f/security-cryptography/key-exchange-protocols/group-exchanges.md) — Establishes a shared secret using the Diffie-Hellman group exchange algorithm. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Security.html))
- [Password Authentication](https://awesome-repositories.com/f/security-cryptography/password-authentication.md) — Provides password-based SSH authentication as a core connection method. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.PasswordAuthenticationMethod.html))
- [SSH Private Key Authentications](https://awesome-repositories.com/f/security-cryptography/private-key-import-formats/ssh-private-key-authentications.md) — Provides private key authentication for SSH connections using multiple key formats. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.PrivateKeyFile.html))
- [SSH Authentication](https://awesome-repositories.com/f/security-cryptography/ssh-authentication.md) — Supports multiple SSH authentication methods including passwords, keys, certificates, and keyboard-interactive.
- [Pluggable Authentication Methods](https://awesome-repositories.com/f/security-cryptography/ssh-authentication/pluggable-authentication-methods.md) — Supports password, public key, and keyboard-interactive authentication, including multi-factor combinations, over SSH. ([source](https://cdn.jsdelivr.net/gh/sshnet/ssh.net@develop/README.md))
- [Certificate-Based Authentication](https://awesome-repositories.com/f/security-cryptography/identity-access-management/identity-management/server-authenticity-verification/certificate-based-authentication.md) — Associates an X.509 certificate with a private key for certificate-based authentication. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.PrivateKeyFile.html))
- [Host Key Verifications](https://awesome-repositories.com/f/security-cryptography/identity-key-management/remote-key-fetchers/host-key-verifications.md) — Provides event data for host key verification, enabling custom validation of server identity. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Common.html))
- [ECDSA Key Generators](https://awesome-repositories.com/f/security-cryptography/private-key-import-formats/ssh-private-key-authentications/ecdsa-key-generators.md) — Creates and holds ECDSA private and public keys for use in SSH authentication. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Security.html))
- [ED25519 Key Generators](https://awesome-repositories.com/f/security-cryptography/private-key-import-formats/ssh-private-key-authentications/ed25519-key-generators.md) — Creates and holds ED25519 private and public keys for use in SSH authentication. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Security.html))
- [RSA Key Generators](https://awesome-repositories.com/f/security-cryptography/private-key-import-formats/ssh-private-key-authentications/rsa-key-generators.md) — Creates and holds RSA private and public keys for use in SSH authentication. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Security.html))
- [Channel Close Timeouts](https://awesome-repositories.com/f/security-cryptography/session-timeout-configurations/channel-close-timeouts.md) — Sets a timeout duration for waiting on server acknowledgment when closing a channel. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ConnectionInfo.html))

### Development Tools & Productivity

- [Stream-Based File Access Abstractions](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/remote-file-reading/remote-file-stream-readers/stream-based-file-access-abstractions.md) — Exposes SFTP and SCP file operations through .NET System.IO.Stream patterns for synchronous and asynchronous read/write access.
- [File Uploads](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems/file-uploads.md) — Provides asynchronous SFTP file uploads with result encapsulation for remote servers. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Sftp.html))
- [SCP and SFTP Subsystem Handlers](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems/scp-and-sftp-subsystem-handlers.md) — Implements SCP protocol for copying files and directories over encrypted SSH connections.
- [SCP Client Libraries](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems/scp-and-sftp-subsystem-handlers/scp-client-libraries.md) — Provides an SCP client library for copying files and directories over SSH.
- [SFTP Client Libraries](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems/sftp-client-libraries.md) — Provides an SFTP client library for transferring files and managing remote file systems.
- [Shell Data Event Handlers](https://awesome-repositories.com/f/development-tools-productivity/event-hooks/shell-event-tracking/shell-data-event-handlers.md) — Processes shell data received events to manage output from interactive sessions. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Common.html))

### DevOps & Infrastructure

- [Dynamic Port Forwarding](https://awesome-repositories.com/f/devops-infrastructure/dashboard-port-forwarding/dynamic-port-forwarding.md) — Creates a SOCKS proxy on the client that forwards connections to destination servers via the SSH server. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.html))
- [Remote Command Execution](https://awesome-repositories.com/f/devops-infrastructure/remote-command-execution.md) — Runs shell commands on remote servers over SSH and captures output, error, and exit status.
- [Process Input Streaming](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/remote-workspace-command-execution/ssh-based-remote-execution/remote-data-streaming/process-input-streaming.md) — Provides writable streams that send data to the standard input of running remote processes. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.SshCommand.html))
- [Background Command Execution](https://awesome-repositories.com/f/devops-infrastructure/remote-command-execution/background-command-execution.md) — Starts remote commands in the background and returns handles to wait for completion without blocking. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.SshCommand.html))
- [Command Termination](https://awesome-repositories.com/f/devops-infrastructure/remote-command-execution/command-termination.md) — Sends termination signals to remote processes to stop execution before natural completion. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.SshCommand.html))

### Networking & Communication

- [Connection Multiplexing](https://awesome-repositories.com/f/networking-communication/connection-multiplexing.md) — Manages multiple concurrent channels over a single SSH connection for simultaneous shell, exec, SFTP, and port forwarding sessions.
- [Network Port Forwarding](https://awesome-repositories.com/f/networking-communication/network-port-forwarding.md) — Creates local, remote, or dynamic port tunnels through an SSH connection to route traffic securely. ([source](https://cdn.jsdelivr.net/gh/sshnet/ssh.net@develop/README.md))
- [Dynamic Port Forwarding](https://awesome-repositories.com/f/networking-communication/network-port-forwarding/dynamic-port-forwarding.md) — Routes client connections through an SSH server to arbitrary destinations via SOCKS proxy-style forwarding. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ForwardedPortDynamic.html))
- [Local Port Forwarding](https://awesome-repositories.com/f/networking-communication/network-port-forwarding/local-port-forwarding.md) — Forwards connections from a local port to a remote endpoint through an SSH tunnel. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.IForwardedPort.html))
- [Remote Port Forwarding](https://awesome-repositories.com/f/networking-communication/port-forwarding-tools/remote-port-forwarding.md) — Forwards connections from a remote port to a local endpoint through an SSH tunnel. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.IForwardedPort.html))
- [SSH Port Forwarding Libraries](https://awesome-repositories.com/f/networking-communication/port-forwarding-tools/remote-port-forwarding/ssh-port-forwarding-libraries.md) — Provides an SSH port forwarding library for creating local, remote, and dynamic encrypted tunnels.
- [SSH Client Connections](https://awesome-repositories.com/f/networking-communication/ssh-client-connections.md) — Establishes SSH client connections with configurable host, port, and authentication parameters. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ConnectionInfo.html))
- [SFTP File Transfers](https://awesome-repositories.com/f/networking-communication/ssh-server-frameworks/ssh-file-transfer-servers/sftp-file-transfers.md) — Provides comprehensive SFTP file transfer with streaming, metadata, and synchronization capabilities.
- [SSH Session Management](https://awesome-repositories.com/f/networking-communication/ssh-session-management.md) — Releases all unmanaged resources held by the SSH session to clean up connections. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Session.html))
- [SSH Tunneling Forwarders](https://awesome-repositories.com/f/networking-communication/unix-domain-socket-support/tunneled-unix-socket-forwarding/ssh-tunneling-forwarders.md) — Creates local, remote, and dynamic port tunnels through SSH connections for secure traffic routing.
- [Session Channel Limiters](https://awesome-repositories.com/f/networking-communication/concurrent-remote-session-managers/session-channel-limiters.md) — Restricts the maximum number of simultaneous session channels to control resource usage. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ConnectionInfo.html))
- [Keep-Alive Signaling](https://awesome-repositories.com/f/networking-communication/nat-traversal-mechanisms/keep-alive-signaling.md) — Transmits a keep-alive signal to the server to maintain an idle connection. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.IBaseClient.html))
- [NetConf Management Clients](https://awesome-repositories.com/f/networking-communication/netconf-management-clients.md) — Ships a NETCONF client library for configuring and managing network devices over SSH.
- [SSH Proxy Connections](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-management/dns-connectivity-management/network-connectivity-configurations/proxy-connection-sharing/proxy-connection-configurations/ssh-proxy-connections.md) — Routes SSH connections through SOCKS4, SOCKS5, and HTTP proxy servers for secure remote access. ([source](https://cdn.jsdelivr.net/gh/sshnet/ssh.net@develop/README.md))
- [Session Channel Retries](https://awesome-repositories.com/f/networking-communication/network-reliability-diagnostics/connection-session-management/automated-retry-sessions/session-channel-retries.md) — Automatically retries creating a session channel a configurable number of times after failure. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ConnectionInfo.html))

### System Administration & Monitoring

- [Remote Server Connectivities](https://awesome-repositories.com/f/system-administration-monitoring/administrative-operations/linux-system-administration/networking/connection-lifecycle-management/remote-server-connectivities.md) — Establishes asynchronous SSH connections to remote servers with cancellation support. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.BaseClient.html))
- [Interactive Remote Shells](https://awesome-repositories.com/f/system-administration-monitoring/cli-session-launchers/interactive-remote-shells.md) — Opens interactive terminal sessions on remote servers for real-time command input and output.
- [Non-Interactive Remote Shells](https://awesome-repositories.com/f/system-administration-monitoring/cli-session-launchers/interactive-remote-shells/non-interactive-remote-shells.md) — Opens a shell session without a pseudo-terminal by streaming input and output through provided streams. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ISshClient.html))
- [Output Pattern Matching](https://awesome-repositories.com/f/system-administration-monitoring/interactive-remote-shells/output-pattern-matching.md) — Blocks execution until a specified text pattern or regular expression appears in the shell output. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.ShellStream.html))

### Artificial Intelligence & ML

- [SSH Session Disconnection Events](https://awesome-repositories.com/f/artificial-intelligence-ml/realtime-ai-session-managers/session-connect-disconnect-emitters/ssh-session-disconnection-events.md) — Raises an event when the SSH session is disconnected from the remote server. ([source](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.Session.html))

### Part of an Awesome List

- [Network Protocols](https://awesome-repositories.com/f/awesome-lists/devtools/network-protocols.md) — Secure Shell library for SSH, SFTP, and SCP operations.
