udwSsh

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ScpCmdPrefix = "scp" + SshOption
View Source
const SshOption = " -C -o StrictHostKeyChecking=no -o PasswordAuthentication=no "

Variables

This section is empty.

Functions

func AvailableCheck

func AvailableCheck(ip string) (isReachable, havePermission bool)

func MustMakeRootAvailableM1

func MustMakeRootAvailableM1(remote RemoteServer)

func MustRpcSsh

func MustRpcSsh(remote RemoteServer, cmd ...string) []byte

func MustRpcSshDefault

func MustRpcSshDefault(ip string, cmd ...string) []byte

func MustRpcSshDefaultWithBashContent

func MustRpcSshDefaultWithBashContent(ip string, bash string) []byte

func MustScpToRemote

func MustScpToRemote(remote *RemoteServer)

func MustScpToRemoteDefault

func MustScpToRemoteDefault(ip, localFileRealPath, remoteFileRealPath string)

func MustSshCopyidWithIpAndCertContent

func MustSshCopyidWithIpAndCertContent(ip string, certContent string)

func MustSshInstallRootCertification

func MustSshInstallRootCertification(req MustSshInstallRootCertificationRequest)

func RpcSsh

func RpcSsh(remote RemoteServer, cmd ...string) (stdout []byte, err error)

func RpcSshDefault

func RpcSshDefault(ip string, cmd ...string) (b []byte, err error)

func Scp

func Scp(req ScpReq) error

func ScpToRemote

func ScpToRemote(remote *RemoteServer) error

func ScpToRemoteDefault

func ScpToRemoteDefault(ip, localFileRealPath, remoteFileRealPath string) error

func SshCopyId

func SshCopyId(remote RemoteServer)

Types

type MustSshInstallRootCertificationRequest

type MustSshInstallRootCertificationRequest struct {
	Ip                     string
	InPassword             string
	RootCertificateContent string
}

type RemoteServer

type RemoteServer struct {
	Ip                string
	Port              int
	UserName          string
	ClientKeyFilePath string

	Password    string
	CertContent string

	IsScp         bool
	LocalPath     string
	RemotePath    string
	TimeoutSecond int
}

func (RemoteServer) String

func (r RemoteServer) String() string

type ScpReq

type ScpReq struct {
	Ip                     string
	User                   string
	Port                   int
	IsUpload               bool
	LocalPath              string
	RemotePath             string
	OptionCompressionLevel int
}

Jump to

Keyboard shortcuts

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