sshd

package
v0.0.0-...-cac5726 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrEOF is the error when the terminal exits
	ErrEOF = errors.New("EOF")
)

Functions

func DirectTCPIPHandler

func DirectTCPIPHandler(ctx context.Context, srv *Server, conn *gossh.ServerConn, newChan gossh.NewChannel)

DirectTCPIPHandler can be enabled by adding it to the server's ChannelHandlers under direct-tcpip.

func InitDebug

func InitDebug(kr *mesh.KRun)

func InitFromSecret

func InitFromSecret(sshCM map[string][]byte, ns string)

InitFromSecret is a helper method to init the sshd using a secret or CA address

func KeysEqual

func KeysEqual(ak, bk gossh.PublicKey) bool

KeysEqual is constant time compare of the keys to avoid timing attacks.

Types

type ForwardedTCPHandler

type ForwardedTCPHandler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ForwardedTCPHandler can be enabled by creating a ForwardedTCPHandler and adding the HandleSSHRequest callback to the server's RequestHandlers under tcpip-forward and cancel-tcpip-forward.

func (*ForwardedTCPHandler) HandleSSHRequest

func (h *ForwardedTCPHandler) HandleSSHRequest(ctx context.Context, srv *Server, req *gossh.Request, conn *gossh.ServerConn) (bool, []byte)

type Pty

type Pty struct {
	Term   string
	Window Window
}

Pty represents a PTY request and configuration.

type SSHDConfig

type SSHDConfig struct {
	Port int
}

type Server

type Server struct {
	Port           int
	Shell          string
	AuthorizedKeys []gossh.PublicKey

	CertChecker *gossh.CertChecker
	Address     string
	Listener    net.Listener
	// contains filtered or unexported fields
}

func NewSSHTransport

func NewSSHTransport(signer gossh.Signer, name, domain, root string) (*Server, error)

func (*Server) AddAuthorized

func (s *Server) AddAuthorized(extra string)

func (*Server) AddAuthorizedFile

func (s *Server) AddAuthorizedFile(auth []byte)

func (*Server) AddAuthorizedKeys

func (srv *Server) AddAuthorizedKeys(keys []gossh.PublicKey)

func (*Server) HandleServerConn

func (sshGate *Server) HandleServerConn(nConn net.Conn)

Handles a connection as SSH server, using a net.Conn - which might be tunneled over other transports. SSH handles multiplexing and packets.

func (*Server) Start

func (t *Server) Start()

type Signal

type Signal string

type Window

type Window struct {
	Width  int
	Height int
}

Window represents the size of a PTY window.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL