Expand description
Support for tailnet-native, in-process SSH servers.
§Overview
This module (tailscale::ssh) holds helpers for running SSH servers on the tailnet
using russh. They delegate their functionality to the Handler trait, which is
russh’s notion of a connection handler, i.e. a single incoming TCP connection gets
a single instance of Handler.
§Channels
SSH has a nested notion of channels, which are multiplexed over a single connection. The terminal session you open over a normal machine-to-machine ssh connection runs in a channel, and in principle, you can have multiple channels open on the same connection.
The channel_server module provides a ChannelServer type that separates out the
per-channel handler logic from russh’s monolithic Handler. Channel handler logic
is supported here by ChannelHandler, which is passed into ChannelServer and
processes a ChannelEvent stream for each channel that’s opened.
§Terminal applications
Support for building per-channel terminal application is provided by RatatuiTerm,
which implements ChannelHandler to drive a
ratatui::Terminal. The user provides an implementation of
RatatuiApp that consumes input data and supports draws to the screen, and the
RatatuiTerm drives it automatically.
Re-exports§
pub extern crate russh;
Structs§
- Channel
Server - Implementation of
russh::server::Handlerwhich provides per-channel session handlers using a parametricChannelHandler. - Ratatui
Term - A
ChannelHandlerthat runs aRatatuiApp. - Shell
Handler - A turnkey
ChannelHandlerthat runs the authorized user’s login shell in a PTY. - SshAccept
- Details of an accepted SSH connection.
- SshPolicy
- An owned Tailscale SSH policy. Mirrors
tailcfg.SSHPolicy.
Enums§
- Channel
Event - An event that may be generated by a channel connected to a
ChannelServer. - SshDecision
- The outcome of evaluating an
SshPolicyagainst a connection. - SshDeny
Reason - Why a connection was denied. Mirrors Go’s
rejected/rejectedUserresults plus an explicit reject action.
Traits§
- Channel
Handler - Handler for a channel session.
- Ratatui
App - A
ratatuiapplication designed to be driven by aChannelServer. - Ratatui
Env - Terminal environment for
RatatuiApp. - Tailnet
Server - Trait to construct a new
Handlerfrom a TailscaleDeviceand the address of a connecting client.