ssh

package module
v0.0.0-...-2196d86 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SSH_ECPREFIX = "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABB"

Variables

View Source
var (

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

Functions

func LoadAuthorizedKeys

func LoadAuthorizedKeys(path string) ([]ssh.PublicKey, error)

LoadAuthorizedKeys loads path as an array. It will return nil if path doesn't exist.

func SSHKey2Crypto

func SSHKey2Crypto(auth *auth.Auth, keyRSA []byte) (crypto.PrivateKey, error)

Convert from SSH to crypto

func SignSSHHost

func SignSSHHost(a *auth.Auth, hn string)

func SignSSHUser

func SignSSHUser(a *auth.Auth, hn string)

Types

type SSHConn

type SSHConn struct {
	LastSeen    time.Time
	ConnectTime time.Time
	// contains filtered or unexported fields
}

func (*SSHConn) OpenStream

func (c *SSHConn) OpenStream() (*sshstream, error)

OpenStream creates a new stream. This uses the same channel in both directions.

type Server

type Server struct {
	Port           int
	Shell          string
	AuthorizedKeys []ssh.PublicKey
	// contains filtered or unexported fields
}

func NewSSHTransport

func NewSSHTransport(ug *ugatesvc.UGate, auth *auth.Auth) (*Server, error)

func (*Server) NewConn

func (t *Server) NewConn(nc net.Conn, isServer bool) (*SSHConn, error)

NewConn wraps a net.Conn using SSH for MUX and security.

func (*Server) Start

func (t *Server) Start()

Jump to

Keyboard shortcuts

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