ssh

package
v0.0.0-...-f475f95 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Minute

DefaultTimeout is the 1 minute for ssh.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSH

type SSH struct {
	User       string
	Password   string
	PkFile     string
	PkPassword string
	Timeout    time.Duration
}

func NewSSH

func NewSSH(user, password, pkFile, pkPassword string, timeout time.Duration) *SSH

NewSSH returns a new SSH struct.

func (*SSH) Cmd

func (ss *SSH) Cmd(host string, cmd string) string

Cmd is in host exec cmd

func (*SSH) Copy

func (ss *SSH) Copy(host, localFilePath, remoteFilePath string)

func (*SSH) NewSession

func (ss *SSH) NewSession(host string) (*ssh.Session, error)

NewSession returns a new session.

Jump to

Keyboard shortcuts

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