sshs

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2021 Murray Inc. All Rights Reserved.

2021/10/29 11:17, by m18527, create ----------------------------------- SSH工具类

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecLocalCmd

func ExecLocalCmd(cmd string) ([]string, error)

执行本地执行

Types

type SSHClient

type SSHClient struct {
	// contains filtered or unexported fields
}

func NewSSHClient

func NewSSHClient(host, username, password string) (*SSHClient, error)

创建SSH客户端

func (*SSHClient) CloseClient

func (c *SSHClient) CloseClient() error

关闭SSH客户端

func (*SSHClient) ExecCmd

func (c *SSHClient) ExecCmd(cmd string) ([]string, error)

执行指令

func (*SSHClient) ExecCmdWithSession

func (c *SSHClient) ExecCmdWithSession(session *ssh.Session, cmd string) ([]string, error)

指定ssh session 和 cmd 执行指令

func (*SSHClient) NewSession

func (c *SSHClient) NewSession() (*ssh.Session, error)

创建SSH Session

Jump to

Keyboard shortcuts

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