ssh

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostPassword  = 1 // 密码认证
	HostPublicKey = 2 // 公钥认证
)
View Source
const SSHConnectTimeout = 10

Variables

This section is empty.

Functions

func Exec

func Exec(sshConfig SSHConfig, cmd string) (output string, err error)

执行shell命令

Types

type HostAuthType

type HostAuthType int8 // 认证方式

type Result

type Result struct {
	Output string
	Err    error
}

type SSHConfig

type SSHConfig struct {
	AuthType    HostAuthType
	User        string
	Password    string
	PrivateKey  string
	Host        string
	Port        int
	ExecTimeout int // 执行超时时间
}

Jump to

Keyboard shortcuts

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