MIT · Transport only

SSH as a
byte channel

Schipper.Io.Ssh is a from-scratch SSH-2 server and client. ECDH P-256, [email protected], one session channel. No terminal library. You adapt SshSession to whatever you render.

P-256
ECDH
GCM
AES-256
1
Session channel
0
Package deps

Handshake fail-closed. Window credited on read.

No port forwarding. Client sessions have no pty. SshHostKey is public so you can reuse it as identity.

Server and client

Listen with a handler, or SshClient.ConnectAsync with a host-key verifier. Subsystems replace the shell when you say so.

Flow control

The receive window is credited when the application reads. CHANNEL_EOF is read EOF. A dead transport throws, not a clean zero.

Auth as you want it

PublicKeyAuth null accepts anything. When set, publickey is verified; none and password still succeed so the app can log in.

Listen. Read. Write.

The server disposes the session after the handler returns. Half-close with CompleteWritesAsync.

C#
SshHostKey hostKey = SshHostKey.LoadOrCreate("host.key");
var server = new SshServer(
    new IPEndPoint(IPAddress.Any, 2222),
    HandleShellAsync,
    hostKey);

await server.RunAsync(cancellationToken);

static async Task HandleShellAsync(SshSession session, ...)
{
    int n = await session.ReadAsync(buffer, ct);
    if (n == 0) return;
    await session.WriteAsync(buffer.AsMemory(0, n), ct);
}

Source on GitHub

Zero package dependencies. BCL crypto only.

Repository