ssh

package
v0.0.0-...-9b16b4d Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthNone uint8 = iota
	AuthPassword
	AuthPublicKey
	AuthKeyboardInteractive
)

Variables

This section is empty.

Functions

func MarshalAuthorizedKey

func MarshalAuthorizedKey(key ssh.PublicKey) []byte

func NewSSHProxier

func NewSSHProxier(hosts map[string]Host, keys []ssh.Signer) *proxier

Types

type ConnHandler

type ConnHandler interface {
	HandleConn(*Ctx)
}

type Ctx

type Ctx struct {
	//unsync readonly
	Id uint64

	Meta ssh.ConnMetadata

	User string
	Alt  string
	// contains filtered or unexported fields
}

func (*Ctx) Error

func (ctx *Ctx) Error(err_msg string)

type Host

type Host struct {
	Name string

	Addr string

	Pubkey ssh.PublicKey

	User        string
	IdentityKey ssh.Signer
	Password    string

	AllowedUsers utils.GroupRegexp
}

type Midware

type Midware struct {
	PasswordCallback  PasswordCbFn
	PublicKeyCallback PublicKeyCbFn
	// contains filtered or unexported fields
}

func NewSSHController

func NewSSHController(private_keys []ssh.Signer, banner string, quotes []string, pwdcb PasswordCbFn, pubcb PublicKeyCbFn) *Midware

func (*Midware) AddHandler

func (c *Midware) AddHandler(h ConnHandler, alt utils.GroupRegexp)

func (*Midware) Handle

func (ctl *Midware) Handle(c *tcp.Conn) tcp.SerRet

type PasswordCbFn

type PasswordCbFn func(ctx *Ctx, password []byte) bool

type PublicKeyCbFn

type PublicKeyCbFn func(ctx *Ctx, key ssh.PublicKey) bool

Jump to

Keyboard shortcuts

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