This is a Tailscale fork of gliderlabs/ssh.
This Go package wraps the crypto/ssh package with a higher-level API for building SSH servers. The goal of the API was to make it as simple as using net/http, so the API is very similar:
package main
import (
"io"
"log"
ssh "github.com/tailscale/gliderssh"
)
func main() {
ssh.Handle(func(s ssh.Session) {
io.WriteString(s, "Hello world\n")
})
log.Fatal(ssh.ListenAndServe(":2222", nil))
}A bunch of great examples are in the _examples directory.
Pull requests are welcome! However, since this project is very much about API design, please submit API changes as issues to discuss before submitting PRs.