Documentation
¶
Overview ¶
Package sshtest is an SSH server on loopback for tests of magpie's SSH proxy: it logs a user in by password or key and answers each direct-tcpip channel (ssh -D's CONNECT) with an http.Handler of its own, so nothing a test sends through it leaves the machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
User, Pass string
Key ssh.PublicKey // a key the user may log in with
Handler http.Handler
HostSigner ssh.Signer // the server's host key; a new one when nil
// Version is the banner, "SSH-2.0-Go" when empty; a real OpenSSH's
// has a space ("SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20")
Version string
// Interactive offers keyboard-interactive and refuses it at once, as
// OpenSSH without PAM does
Interactive bool
// Forward is how a forward is answered: "" carries it, "prohibit"
// refuses it as AllowTcpForwarding no does, "hangup" ends the whole
// connection as macOS 27's sshd does
Forward string
}
Options are who may log in and what a channel opened through the server answers. A nil Handler answers "carried <host><path>".
type Server ¶
type Server struct {
Addr string // host:port
URL string // ssh://host:port
HostKey string // its host key, authorized_keys form
// contains filtered or unexported fields
}
Server is one SSH server a test stood up; it ends with the test.