Versions in this module Expand all Collapse all v0 v0.0.2 May 15, 2023 Changes in this version + var ContextKeyClientVersion = &contextKey + var ContextKeyConn = &contextKey + var ContextKeyLocalAddr = &contextKey + var ContextKeyPermissions = &contextKey + var ContextKeyPublicKey = &contextKey + var ContextKeyRemoteAddr = &contextKey + var ContextKeyServer = &contextKey + var ContextKeyServerVersion = &contextKey + var ContextKeySessionID = &contextKey + var ContextKeyUser = &contextKey + var DefaultChannelHandlers = map[string]ChannelHandler + var DefaultRequestHandlers = map[string]RequestHandler + var DefaultSubsystemHandlers = map[string]SubsystemHandler + var ErrServerClosed = errors.New("ssh: Server closed") + func AgentRequested(sess Session) bool + func DefaultSessionHandler(srv *Server, conn *gossh.ServerConn, newChan gossh.NewChannel, ctx Context) + func DirectTCPIPHandler(srv *Server, conn *gossh.ServerConn, newChan gossh.NewChannel, ctx Context) + func ForwardAgentConnections(l net.Listener, s Session) + func Handle(handler Handler) + func KeysEqual(ak, bk PublicKey) bool + func ListenAndServe(addr string, handler Handler, options ...Option) error + func NewAgentListener() (net.Listener, error) + func Serve(l net.Listener, handler Handler, options ...Option) error + func SetAgentRequested(ctx Context) + type ChannelHandler func(srv *Server, conn *gossh.ServerConn, newChan gossh.NewChannel, ctx Context) + type ConnCallback func(ctx Context, conn net.Conn) net.Conn + type ConnectionFailedCallback func(conn net.Conn, err error) + type Context interface + ClientVersion func() string + LocalAddr func() net.Addr + Permissions func() *Permissions + RemoteAddr func() net.Addr + ServerVersion func() string + SessionID func() string + SetValue func(key, value interface{}) + User func() string + type ForwardedTCPHandler struct + func (h *ForwardedTCPHandler) HandleSSHRequest(ctx Context, srv *Server, req *gossh.Request) (bool, []byte) + type Handler func(Session) + var DefaultHandler Handler + type KeyboardInteractiveHandler func(ctx Context, challenger gossh.KeyboardInteractiveChallenge) bool + type LocalPortForwardingCallback func(ctx Context, destinationHost string, destinationPort uint32) bool + type Option func(*Server) error + func HostKeyFile(filepath string) Option + func HostKeyPEM(bytes []byte) Option + func KeyboardInteractiveAuth(fn KeyboardInteractiveHandler) Option + func NoPty() Option + func PasswordAuth(fn PasswordHandler) Option + func PublicKeyAuth(fn PublicKeyHandler) Option + func WrapConn(fn ConnCallback) Option + type PasswordHandler func(ctx Context, password string) bool + type Permissions struct + type Pty struct + Term string + Window Window + type PtyCallback func(ctx Context, pty Pty) bool + type PublicKey interface + func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) + func ParsePublicKey(in []byte) (out PublicKey, err error) + type PublicKeyHandler func(ctx Context, key PublicKey) bool + type RequestHandler func(ctx Context, srv *Server, req *gossh.Request) (ok bool, payload []byte) + type ReversePortForwardingCallback func(ctx Context, bindHost string, bindPort uint32) bool + type Server struct + Addr string + ChannelHandlers map[string]ChannelHandler + ConnCallback ConnCallback + ConnectionFailedCallback ConnectionFailedCallback + Handler Handler + HostSigners []Signer + IdleTimeout time.Duration + KeyboardInteractiveHandler KeyboardInteractiveHandler + LocalPortForwardingCallback LocalPortForwardingCallback + MaxTimeout time.Duration + PasswordHandler PasswordHandler + PtyCallback PtyCallback + PublicKeyHandler PublicKeyHandler + RequestHandlers map[string]RequestHandler + ReversePortForwardingCallback ReversePortForwardingCallback + ServerConfigCallback ServerConfigCallback + SessionRequestCallback SessionRequestCallback + SubsystemHandlers map[string]SubsystemHandler + Version string + func (srv *Server) AddHostKey(key Signer) + func (srv *Server) Close() error + func (srv *Server) Handle(fn Handler) + func (srv *Server) HandleConn(newConn net.Conn) + func (srv *Server) ListenAndServe() error + func (srv *Server) Serve(l net.Listener) error + func (srv *Server) SetOption(option Option) error + func (srv *Server) Shutdown(ctx context.Context) error + type ServerConfigCallback func(ctx Context) *gossh.ServerConfig + type Session interface + Break func(c chan<- bool) + Command func() []string + Context func() context.Context + Environ func() []string + Exit func(code int) error + LocalAddr func() net.Addr + Permissions func() Permissions + Pty func() (Pty, <-chan Window, bool) + PublicKey func() PublicKey + RawCommand func() string + RemoteAddr func() net.Addr + Signals func(c chan<- Signal) + Subsystem func() string + User func() string + type SessionRequestCallback func(sess Session, requestType string) bool + type Signal string + const SIGABRT + const SIGALRM + const SIGFPE + const SIGHUP + const SIGILL + const SIGINT + const SIGKILL + const SIGPIPE + const SIGQUIT + const SIGSEGV + const SIGTERM + const SIGUSR1 + const SIGUSR2 + type Signer interface + type SubsystemHandler func(s Session) + type Window struct + Height int + Width int