sshd

package
v1.67.12 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerVersion    = "SSH-2.0-slicc"
	EvalSubsystem    = "slicc-eval"
	SFTPSubsystem    = "sftp"
	DefaultEvalQuiet = 500 * time.Millisecond
)

Variables

View Source
var (
	ErrNoRunner = errors.New("slicc runs no commands on this machine: it was started without a runner")
	ErrRefused  = fmt.Errorf("slicc: forwarding is not allowed from this machine: %w", os.ErrPermission)
)

Functions

func AuthorizedKey

func AuthorizedKey(key ssh.PublicKey) string

func DefaultHostKey

func DefaultHostKey() (ssh.Signer, error)

func ExecArgv

func ExecArgv(runner []string, command string) []string

func HostKeyPath

func HostKeyPath() (string, error)

func LoadHostKey

func LoadHostKey(path string) (ssh.Signer, error)

func SFTPDefault added in v1.5.0

func SFTPDefault(runner []string) bool

func ShellFor

func ShellFor(runner []string) []string

Types

type Config

type Config struct {
	HostKey   ssh.Signer
	Runner    []string
	Shell     []string
	Eval      []string
	EvalQuiet time.Duration
	Dialer    Dialer
	Dir       string
	NoSFTP    bool
}

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type RefuseAll

type RefuseAll struct{}

func (RefuseAll) DialContext

func (RefuseAll) DialContext(context.Context, string, string) (net.Conn, error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) HostKey

func (s *Server) HostKey() ssh.PublicKey

func (*Server) ServeConn

func (s *Server) ServeConn(c net.Conn) error

Jump to

Keyboard shortcuts

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