ssh

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 37 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AUTHKEY_PASSWORD = "password"
	AUTHKEY_AGENT    = "agent"
	AUTHKEY_KEY      = "key"
	AUTHKEY_CERT     = "cert"
	AUTHKEY_PKCS11   = "pkcs11"
)
View Source
const SSH_AUTH_SOCK = "SSH_AUTH_SOCK"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthKey added in v0.5.5

type AuthKey struct {
	// auth type:
	//   - password
	//   - agent
	//   - key
	//   - cert
	//   - pkcs11
	Type string

	// auth type value:
	//   - key(path)
	//     ex.) ~/.ssh/id_rsa
	//   - cert(path)
	//     ex.) ~/.ssh/id_rsa.crt
	//   - pkcs11(libpath)
	//     ex.) /usr/local/lib/opensc-pkcs11.so
	Value string
}

Auth map key

type P11 added in v0.5.3

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

P11 struct for pkcs11 processing.

func (*P11) CreateCtx added in v0.5.3

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

CreateCtx create and into P11.Ctx

func (*P11) Get added in v0.5.5

func (p *P11) Get() (cryptoSigners []crypto.Signer, err error)

Get return []crypto.Signer, do a series of processing.

func (*P11) GetCryptoSigner added in v0.5.3

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

GetCryptoSigner return []crypto.Signer

func (*P11) GetKeyID added in v0.5.3

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

GetKeyID acquire KeyID via PKCS11 and store it in P11 structure.

func (*P11) GetPIN added in v0.5.3

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

GetPin prompt for PIN if P11.Pin is blank

func (*P11) GetTokenLabel added in v0.5.3

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

GetTokenLabel get pkcs11 token label. and into P11.Label. Only one token is supported.

func (*P11) RecreateCtx added in v0.5.3

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

RecreateCtx exchange PKCS11.Ctx with PIN accessible ctx

type PathSet added in v0.6.0

type PathSet struct {
	Base      string
	PathSlice []string
}

use scp,sftp

type PipeSet added in v0.6.0

type PipeSet struct {
	// contains filtered or unexported fields
}

PipeSet is pipe in/out set struct.

type Run added in v0.5.0

type Run struct {
	ServerList []string
	Conf       conf.Config

	// Mode value in
	//     - shell
	//     - cmd
	//     - pshell
	Mode string

	// tty use (-t option)
	IsTerm bool

	// parallel connect (-p option)
	IsParallel bool

	// not run (-N option)
	IsNone bool

	// x11 forwarding (-X option)
	X11 bool

	// use or not-use local bashrc.
	// IsNotBashrc takes precedence.
	IsBashrc    bool
	IsNotBashrc bool

	// local/remote Port Forwarding
	PortForwardMode   string // L or R
	PortForwardLocal  string
	PortForwardRemote string

	// Dynamic Port Forwarding
	// set localhost port num (ex. 11080).
	DynamicPortForward string

	// Exec command
	ExecCmd []string

	// enable/disable print header in command mode
	EnableHeader  bool
	DisableHeader bool
	// contains filtered or unexported fields
}

func (*Run) CreateAuthMethodMap added in v0.6.0

func (r *Run) CreateAuthMethodMap()

CreateAuthMethodMap Create ssh.AuthMethod, into r.AuthMethodMap.

func (*Run) CreateSshConnect added in v0.6.0

func (r *Run) CreateSshConnect(server string) (connect *sshlib.Connect, err error)

CreateSshConnect return *sshlib.Connect this vaule in ssh.Client with proxy.

func (*Run) PrintSelectServer added in v0.6.0

func (r *Run) PrintSelectServer()

PrintSelectServer is printout select server. use ssh login header.

func (*Run) SetupSshAgent added in v0.6.0

func (r *Run) SetupSshAgent()

func (*Run) Start added in v0.5.0

func (r *Run) Start()

Start ssh connect

Jump to

Keyboard shortcuts

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