Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthKeySource ¶
AuthKeySource provides authorized-key checks for the SSH server. Implementations must use constant-time comparison when comparing keys.
type FileAuth ¶
type FileAuth struct {
// contains filtered or unexported fields
}
FileAuth implements AuthKeySource by reading authorized keys from a file (e.g. OpenSSH authorized_keys format). The file is read at construction. Changes to the file require a new FileAuth.
func NewFileAuth ¶
NewFileAuth reads the file at path and parses it as authorized_keys (one key per line, ssh.ParseAuthorizedKey). Returns an error if the file cannot be read; invalid lines are skipped.
type Server ¶
type Server struct {
ListenAddr string
AuthKeys AuthKeySource
HostKeyPath string
}
Server is a TCP SSH server that authenticates by public key and serves a simple session message. It does not depend on config or CLI; all data is passed via struct fields.
func (*Server) ListenAndServe ¶
ListenAndServe starts the SSH server on s.ListenAddr. It does not return until the server exits. If HostKeyPath is set, that file is used; otherwise an ephemeral in-memory key is used for this process.