ssh

package
v0.0.0-...-c8b181b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthFn

type AuthFn func() (ssh.AuthMethod, error)

func AgentAuth

func AgentAuth() AuthFn

type PubKeyData

type PubKeyData struct {
	Name      string `yaml:"name"`
	PublicKey string `yaml:"public_key"`
}

type SSH

type SSH struct {
	Client *ssh.Client
}

func New

func New(serverUser string, addr string, authFn AuthFn) (*SSH, error)

Connect to ssh and get client, the host public key must be in known hosts.

func (*SSH) Close

func (s *SSH) Close() error

func (*SSH) Exec

func (s *SSH) Exec(cmd string) (string, error)

Exec runs a command on the remote server.

Jump to

Keyboard shortcuts

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