ssh

package
v0.0.0-...-0325488 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: AGPL-3.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultipleFixedHostKeys

func MultipleFixedHostKeys(keys []stdSSH.PublicKey) stdSSH.HostKeyCallback

MultipleFixedHostKeys is a HostKeyCallback that checks multiple host keys

Types

type Session

type Session struct {
	SFTP *sftp.Client
	// contains filtered or unexported fields
}

Session is a wrapper of ssh.Client to make calls easier

func NewSessionWithKey

func NewSessionWithKey(fs afero.Fs, host string, port int, user string, keysPath string, hostKeys []string) (*Session, error)

NewSessionWithKey creates a new session using a private key as authentication

func NewSessionWithPassword

func NewSessionWithPassword(host string, port int, user, pass string, hostKeys []string) (*Session, error)

NewSessionWithPassword creates a new session using a password as authentication

func (*Session) Close

func (s *Session) Close() error

Close closes the session

func (*Session) Exec

func (s *Session) Exec(cmd string) ([]byte, error)

Exec executes a command and gets the output

Jump to

Keyboard shortcuts

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