internal

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilServerConnection = errors.New("The server connection was nil for the client")
View Source
var Version string

Functions

func DeleteUser

func DeleteUser(us *User)

func FingerprintSHA1Hex

func FingerprintSHA1Hex(pubKey ssh.PublicKey) string

func FingerprintSHA256Hex

func FingerprintSHA256Hex(pubKey ssh.PublicKey) string

func GeneratePrivateKey

func GeneratePrivateKey() ([]byte, error)

func ListUsers

func ListUsers() (userList []string)

func ParseDims

func ParseDims(b []byte) (uint32, uint32)

ParseDims extracts terminal dimensions (width x height) from the provided buffer.

func RandomString

func RandomString(length int) (string, error)

func RegisterChannelCallbacks

func RegisterChannelCallbacks(user *User, chans <-chan ssh.NewChannel, log logger.Logger, handlers map[string]ChannelHandler) error

func SendRequest

func SendRequest(req ssh.Request, sshChan ssh.Channel) (bool, error)

Types

type ChannelHandler

type ChannelHandler func(user *User, newChannel ssh.NewChannel, log logger.Logger)

type ChannelOpenDirectMsg

type ChannelOpenDirectMsg struct {
	Raddr string
	Rport uint32
	Laddr string
	Lport uint32
}

type ClientInfo added in v1.0.15

type ClientInfo struct {
	Username string
	Hostname string
	GoArch   string
	GoOS     string
}

type PtyReq

type PtyReq struct {
	Term          string
	Columns, Rows uint32
	Width, Height uint32
	Modes         string
}

func ParsePtyReq

func ParsePtyReq(req []byte) (out PtyReq, err error)

type RemoteForwardRequest

type RemoteForwardRequest struct {
	BindAddr string
	BindPort uint32
}

type ShellStruct added in v1.0.8

type ShellStruct struct {
	Cmd string
}

type TimeoutConn

type TimeoutConn struct {
	net.Conn
	Timeout time.Duration
}

func (*TimeoutConn) Read

func (c *TimeoutConn) Read(b []byte) (int, error)

func (*TimeoutConn) Write

func (c *TimeoutConn) Write(b []byte) (int, error)

type User

type User struct {
	// This is the users connection to the server itself, creates new channels and whatnot. NOT to get io.Copy'd
	ServerConnection ssh.Conn

	Pty *PtyReq

	ShellRequests <-chan *ssh.Request

	// Remote forwards sent by user
	SupportedRemoteForwards map[RemoteForwardRequest]bool //(set)

	// So we can capture details about who is currently using the rssh server
	ConnectionDetails string
}

func CreateUser

func CreateUser(ServerConnection ssh.Conn) (us *User, err error)

Jump to

Keyboard shortcuts

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