ssh

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientConfig added in v1.1.0

func CreateClientConfig(host *config.Host) *gossh.ClientConfig

func FixSSHAuth

func FixSSHAuth() error

func GetSSHLocalHost

func GetSSHLocalHost() string

func GetTerminalWidth

func GetTerminalWidth() int

func NewAgent

func NewAgent() (agent.Agent, error)

func Start

func Start(tc *config.TaskConfig) error

Types

type Client

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

func NewClient

func NewClient() *Client

func (*Client) Connect

func (c *Client) Connect(host *config.Host) (err error)

func (*Client) ConnectSftp

func (c *Client) ConnectSftp(host *config.Host) (err error)

func (*Client) Download

func (c *Client) Download(remotePath, localPath string) (err error)

func (*Client) Execute

func (c *Client) Execute(cmd string) (int, error)

func (*Client) ListFilesAndDirs

func (c *Client) ListFilesAndDirs(remotePath string) (items []string, err error)

func (*Client) MakeSession

func (c *Client) MakeSession() (*ssh.Session, error)

func (*Client) RemoteProxy added in v1.1.0

func (c *Client) RemoteProxy(listenAddr, serverAddr string) error

func (*Client) RequestAgentForwarding added in v1.0.2

func (c *Client) RequestAgentForwarding(session *ssh.Session) error

func (*Client) Script

func (c *Client) Script(path string) (int, error)

func (*Client) Shell

func (c *Client) Shell(remoteListen, proxyServer string) error

func (*Client) UpdateTerminalSize

func (c *Client) UpdateTerminalSize(session *ssh.Session)

监听窗口大小变化,并自动调节

func (*Client) Upload

func (c *Client) Upload(localPath, remotePath string) (err error)

Jump to

Keyboard shortcuts

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