Documentation
¶
Index ¶
- Constants
- Variables
- func AgentRequested(sess Session) bool
- 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
- type ConnCallback
- type Context
- type DefaultServerConfigCallback
- type DirectTcpIpHandler
- type Handler
- type KeyboardInteractiveHandler
- type LocalPortForwardingCallback
- type Logger
- type Option
- type PasswordHandler
- type Permissions
- type Pty
- type PtyCallback
- type PublicKey
- type PublicKeyHandler
- type RequestHandler
- type ReversePortForwardingCallback
- type Server
- func (srv *Server) AddHostKey(key Signer)
- func (srv *Server) Close() error
- func (srv *Server) Debug(args ...interface{})
- func (srv *Server) Debugf(format string, args ...interface{})
- func (srv *Server) Debugln(args ...interface{})
- func (srv *Server) Error(args ...interface{})
- func (srv *Server) Errorf(format string, args ...interface{})
- func (srv *Server) Errorln(args ...interface{})
- func (srv *Server) Fatal(args ...interface{})
- func (srv *Server) Fatalf(format string, args ...interface{})
- func (srv *Server) Fatalln(args ...interface{})
- func (srv *Server) Handle(fn Handler)
- func (srv *Server) Info(args ...interface{})
- func (srv *Server) Infof(format string, args ...interface{})
- func (srv *Server) Infoln(args ...interface{})
- func (srv *Server) ListenAndServe() error
- func (srv *Server) Panic(args ...interface{})
- func (srv *Server) Panicf(format string, args ...interface{})
- func (srv *Server) Panicln(args ...interface{})
- func (srv *Server) Print(args ...interface{})
- func (srv *Server) Printf(format string, args ...interface{})
- func (srv *Server) Println(args ...interface{})
- func (srv *Server) Serve(l net.Listener) error
- func (srv *Server) SetOption(option Option) error
- func (srv *Server) Shutdown(ctx context.Context) error
- func (srv *Server) Trace(args ...interface{})
- func (srv *Server) Tracef(format string, args ...interface{})
- func (srv *Server) Traceln(args ...interface{})
- func (srv *Server) Warn(args ...interface{})
- func (srv *Server) Warnf(format string, args ...interface{})
- func (srv *Server) Warning(args ...interface{})
- func (srv *Server) Warningf(format string, args ...interface{})
- func (srv *Server) Warningln(args ...interface{})
- func (srv *Server) Warnln(args ...interface{})
- func (srv *Server) WithError(err error) *logrus.Entry
- func (srv *Server) WithField(key string, value interface{}) *logrus.Entry
- func (srv *Server) WithFields(fields logrus.Fields) *logrus.Entry
- type Session
- type SessionHandler
- type SessionRequestCallback
- type Signal
- type Signer
- type Window
Constants ¶
View Source
const ( SIGABRT = Signal(ssh.SIGABRT) SIGALRM = Signal(ssh.SIGALRM) SIGFPE = Signal(ssh.SIGFPE) SIGHUP = Signal(ssh.SIGHUP) SIGILL = Signal(ssh.SIGILL) SIGKILL = Signal(ssh.SIGKILL) SIGPIPE = Signal(ssh.SIGPIPE) SIGQUIT = Signal(ssh.SIGQUIT) SIGSEGV = Signal(ssh.SIGSEGV) SIGTERM = Signal(ssh.SIGTERM) SIGUSR1 = Signal(ssh.SIGUSR1) SIGUSR2 = Signal(ssh.SIGUSR2) )
Variables ¶
View Source
var ( ContextKeySessionID = &contextKey{"session-id"} ContextKeyClientVersion = &contextKey{"client-version"} ContextKeyServerVersion = &contextKey{"server-version"} ContextKeyUser = &contextKey{"user"} ContextKeyLocalAddr = &contextKey{"local-addr"} ContextKeyRemoteAddr = &contextKey{"remote-addr"} ContextKeyPermissions = &contextKey{"permissions"} ContextKeyLogger = &contextKey{"logger"} ContextKeyServer = &contextKey{"ssh-server"} ContextKeyConn = &contextKey{"ssh-conn"} ContextKeyPublicKey = &contextKey{"public-key"} )
View Source
var ( ErrServerClosed = errors.New("server closed") ErrPermissionDenied = errors.New("permission denied") )
Functions ¶
func AgentRequested ¶
func ForwardAgentConnections ¶
func NewAgentListener ¶
func SetAgentRequested ¶
func SetAgentRequested(ctx Context)
Types ¶
type ChannelHandler ¶
type ChannelHandler interface {
HandleChannel(ctx Context, srv *Server, conn *ssh.ServerConn, newChan ssh.NewChannel)
}
type DefaultServerConfigCallback ¶
type DefaultServerConfigCallback func(ctx Context) *ssh.ServerConfig
type DirectTcpIpHandler ¶
func (*DirectTcpIpHandler) HandleChannel ¶
func (h *DirectTcpIpHandler) HandleChannel(ctx Context, srv *Server, conn *ssh.ServerConn, newChan ssh.NewChannel)
type KeyboardInteractiveHandler ¶
type KeyboardInteractiveHandler func(ctx Context, challenger ssh.KeyboardInteractiveChallenge) bool
type Logger ¶
type Logger interface { logrus.Ext1FieldLogger }
type Option ¶
func HostKeyFile ¶
func HostKeyPEM ¶
func PasswordAuth ¶
func PasswordAuth(fn PasswordHandler) Option
func PublicKeyAuth ¶
func PublicKeyAuth(fn PublicKeyHandler) Option
func WrapConn ¶
func WrapConn(fn ConnCallback) Option
type PasswordHandler ¶
type Permissions ¶
type Permissions struct {
*ssh.Permissions
}
type PtyCallback ¶
type PublicKeyHandler ¶
type RequestHandler ¶
type Server ¶
type Server struct { Addr string Handler Handler HostSigners []Signer Version string Logger Logger KeyboardInteractiveHandler KeyboardInteractiveHandler PasswordHandler PasswordHandler PublicKeyHandler PublicKeyHandler PtyCallback PtyCallback ConnCallback ConnCallback LocalPortForwardingCallback LocalPortForwardingCallback ReversePortForwardingCallback ReversePortForwardingCallback DefaultServerConfigCallback DefaultServerConfigCallback SessionRequestCallback SessionRequestCallback IdleTimeout time.Duration MaxTimeout time.Duration ChannelHandlers map[string]ChannelHandler RequestHandlers map[string]RequestHandler // contains filtered or unexported fields }
func (*Server) AddHostKey ¶
func (*Server) ListenAndServe ¶
type Session ¶
type Session interface { ssh.Channel Logger() Logger User() string RemoteAddr() net.Addr LocalAddr() net.Addr Environ() []string Exit(code int) error ExitSignal(signal os.Signal, coreDumped bool, message, languageTag string) error Command() []string PublicKey() PublicKey Context() context.Context Permissions() Permissions Pty() (Pty, <-chan Window, bool) Notify(c chan<- Signal, sig ...Signal) Reset(sig ...Signal) Stop(c chan<- Signal) }
type SessionHandler ¶
type SessionHandler struct{}
func (SessionHandler) HandleChannel ¶
func (SessionHandler) HandleChannel(ctx Context, srv *Server, conn *ssh.ServerConn, newChan ssh.NewChannel)
type SessionRequestCallback ¶
type Signer ¶
func NewSignerFromKey ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.