ssh

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 25 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProxyList added in v0.5.0

func GetProxyList(server string, config conf.Config) (proxyList []string, proxyType map[string]string, err error)

@brief:

get ssh proxy server slice

Types

type Connect added in v0.5.0

type Connect struct {
	Server      string
	Conf        conf.Config
	Client      *ssh.Client
	StdinWriter io.Writer

	IsTerm           bool
	IsParallel       bool
	IsLocalRc        bool
	LocalRcData      string
	LocalRcDecodeCmd string
	ForwardLocal     string
	ForwardRemote    string
	// contains filtered or unexported fields
}

func (*Connect) ConTerm added in v0.5.0

func (c *Connect) ConTerm(session *ssh.Session) (err error)

@brief:

connect ssh terminal

func (*Connect) CreateClient added in v0.5.3

func (c *Connect) CreateClient() (err error)

@brief: create ssh client @note:

support multiple proxy connect.

func (*Connect) CreateSession added in v0.5.0

func (c *Connect) CreateSession() (session *ssh.Session, err error)

@brief: create ssh session

func (*Connect) CreateSshAgent added in v0.5.3

func (c *Connect) CreateSshAgent() (err error)

func (*Connect) PortForwarder added in v0.5.2

func (c *Connect) PortForwarder()

@brief:

func (*Connect) RunCmd added in v0.5.0

func (c *Connect) RunCmd(session *ssh.Session, command []string) (err error)

@brief:

run command over ssh

func (*Connect) RunCmdWithOutput added in v0.5.1

func (c *Connect) RunCmdWithOutput(session *ssh.Session, command []string, outputChan chan []byte)

@brief:

Run command over ssh, output to gochannel

func (c *Connect) RunCmdWithOutput(session *ssh.Session, command []string, outputChan chan string) {

type CopyConInfo added in v0.5.0

type CopyConInfo struct {
	IsRemote bool
	Path     []string
	Server   []string
}

type P11 added in v0.5.3

type P11 struct {
	Ctx           *pkcs11.Ctx
	Label         string
	SlotID        uint
	KeyID         map[int][]byte
	PIN           string
	SessionHandle pkcs11.SessionHandle
	Signers       []ssh.Signer
}

func (*P11) CreateCtx added in v0.5.3

func (p *P11) CreateCtx(pkcs11Provider string) (err error)

pkcs11Provider ... PATH

func (*P11) GetCryptoSigner added in v0.5.3

func (p *P11) GetCryptoSigner() (signers []crypto.Signer, err error)

func (*P11) GetKeyID added in v0.5.3

func (p *P11) GetKeyID() (err error)

func (*P11) GetPIN added in v0.5.3

func (p *P11) GetPIN() (err error)

func (*P11) GetTokenLabel added in v0.5.3

func (p *P11) GetTokenLabel() (err error)

func (*P11) RecreateCtx added in v0.5.3

func (p *P11) RecreateCtx(pkcs11Provider string) (err error)

type Proxy added in v0.5.0

type Proxy struct {
	Name string
	Type string
}

type Run added in v0.5.0

type Run struct {
	ServerList        []string
	Conf              conf.Config
	IsTerm            bool
	IsParallel        bool
	PortForwardLocal  string
	PortForwardRemote string
	ExecCmd           []string
	StdinData         []byte
	InputData         []byte // @TODO: Delete???
	OutputData        *bytes.Buffer
}

func (*Run) Start added in v0.5.0

func (r *Run) Start()

type RunScp added in v0.5.0

type RunScp struct {
	From       CopyConInfo
	To         CopyConInfo
	CopyData   *bytes.Buffer
	Permission bool
	Config     conf.Config
}

func (*RunScp) Start added in v0.5.0

func (r *RunScp) Start()

@brief:

start

Jump to

Keyboard shortcuts

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