ssh

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Overview

Package ssh provide a wrapper for golang.org/x/crypto/ssh and a parser for SSH client configuration specification ssh_config(5).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*ssh.Client
	// contains filtered or unexported fields
}

Client for SSH connection.

func NewClientFromConfig added in v0.28.0

func NewClientFromConfig(cfg *config.Section) (cl *Client, err error)

NewClientFromConfig create a new SSH connection using predefined configuration. This function may dial twice to find appropriate authentication method when SSH_AUTH_SOCK environment variable is set and IdentityFile directive is specified in Host section.

func (*Client) Execute

func (cl *Client) Execute(cmd string) (err error)

Execute a command on remote server.

func (*Client) ScpGet added in v0.28.0

func (cl *Client) ScpGet(remote, local string) (err error)

ScpGet copy file from remote into local storage using scp.

The local file should be use the absolute path, or relative to the file in config.Section.WorkingDir.

func (*Client) ScpPut added in v0.28.0

func (cl *Client) ScpPut(local, remote string) (err error)

ScpPut copy a file from local storage to remote using scp command.

The local file should be use the absolute path, or relative to the file in config.Section's WorkingDir.

func (*Client) SetSessionOutputError added in v0.29.2

func (cl *Client) SetSessionOutputError(stdout, stderr io.Writer)

SetSessionOutputError set the standard output and error for future remote execution.

func (*Client) String

func (cl *Client) String() string

Directories

Path Synopsis
Package config provide the ssh_config(5) parser and getter.
Package config provide the ssh_config(5) parser and getter.
Package sftp implement SSH File Transfer Protocol v3 as defined in draft-ietf-secsh-filexfer-02.txt.
Package sftp implement SSH File Transfer Protocol v3 as defined in draft-ietf-secsh-filexfer-02.txt.

Jump to

Keyboard shortcuts

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