ssh

package
v0.0.0-...-a4160af Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegexMatches

func GetRegexMatches(user *config.User) []string

GetRegexMatches will return a slice of all of the matching regexes for a user

func ParsePrivateKey

func ParsePrivateKey(pk []byte, passphrase string, env *config.Env) ssh.Signer

ParsePrivateKey pareses the PrivateKey into a ssh.Signer and let's it be used by CASigner

func RandStringBytesMaskImprSrc

func RandStringBytesMaskImprSrc(n int) string

RandStringBytesMaskImprSrc creates a random string of n length https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go/31832326

func Serve

func Serve(addr string, proxyAddr string, env *config.Env)

Serve handles initializing the SSH Server and Proxy

func WaitTimeout

func WaitTimeout(group *sync.WaitGroup, timeout time.Duration) bool

WaitTimeout waits for a waitgroup

Types

type CASigner

type CASigner struct {
	CA          ssh.Signer
	Validity    time.Duration
	Principals  []string
	Permissions []string
}

CASigner is the main CASigner object

func NewCASigner

func NewCASigner(sshsigner ssh.Signer, expireIn time.Duration, principals []string, permissions []string) *CASigner

NewCASigner creates a CASigner from different certificate settings

func (*CASigner) Sign

func (s *CASigner) Sign(env *config.Env, user string, pubKey ssh.PublicKey) (*ssh.Certificate, []byte, error)

Sign creates a certificate that has been signed by the CASigner

type ProxyHandler

type ProxyHandler struct {
	net.Conn
	// contains filtered or unexported fields
}

ProxyHandler is the base handler for an SSH Connection and Proxy

func (*ProxyHandler) Serve

func (p *ProxyHandler) Serve()

Serve handles the proxy

Jump to

Keyboard shortcuts

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