host

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AdminSockExt = ".sock"
)

Variables

This section is empty.

Functions

func AdminClient

func AdminClient(socket string) (api.AdminServiceClient, error)

func AdminSocketFile

func AdminSocketFile(sessionID string) string

func AuthorizedKeys

func AuthorizedKeys(file string) ([]ssh.PublicKey, error)

func NewPromptingHostKeyCallback

func NewPromptingHostKeyCallback(stdin io.Reader, stdout io.Writer, knownHostsFilename string) (ssh.HostKeyCallback, error)

func Signers

func Signers(privateKeys []string) ([]ssh.Signer, func(), error)

Signers return signers based on the folllowing conditions: If private key is not supplied, it returns signers from SSH agent; If SSH agent returns no signer, it generates a private key and returns the corresponding signer. If private key is supplied, it returns signers from SSH agent with matching private keys and adds priavte keys to SSH agent where possible; If there is an error, it falls back to return signers from files

func SignersFromFiles

func SignersFromFiles(privateKeys []string) ([]ssh.Signer, error)

func SignersFromSSHAgent

func SignersFromSSHAgent(socket string) ([]ssh.Signer, func(), error)

SignersFromSSHAgent returns all signers from SSH agent

func SignersFromSSHAgentForKeys added in v0.6.0

func SignersFromSSHAgentForKeys(socket string, privateKeys []string) ([]ssh.Signer, func(), error)

SignersFromSSHAgentForKeys retruns signers from SSH agent for matching private keys. It also adds private key to SSH agent where possbile which simulates the behavior of ssh

Types

type Host

type Host struct {
	Host                   string
	KeepAliveDuration      time.Duration
	Command                []string
	ForceCommand           []string
	Signers                []ssh.Signer
	HostKeyCallback        ssh.HostKeyCallback
	AuthorizedKeys         []ssh.PublicKey
	AdminSocketFile        string
	SessionCreatedCallback func(*api.GetSessionResponse) error
	ClientJoinedCallback   func(*api.Client)
	ClientLeftCallback     func(*api.Client)
	Logger                 log.FieldLogger
	Stdin                  *os.File
	Stdout                 *os.File
	ReadOnly               bool
}

func (*Host) Run

func (c *Host) Run(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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