sshcmds

package module
v0.0.0-...-d8008ff Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 5 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sshcmds

Golang run SSH commands with multiple Private Keys

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config holds details of each key config

func NewConfig

func NewConfig() *Config

NewConfig creates a new instance of the Config struct

func (*Config) AddKey

func (c *Config) AddKey(userName, keyFile string) (err error)

AddKey appends an SSH private key to the list of keys

func (*Config) Auth

func (c *Config) Auth(hostname string) (client *ssh.Client, err error)

Auth returns an ssh.Client struct after successfully authenticating with a key.

func (*Config) Cmd

func (c *Config) Cmd(client *ssh.Client, cmd string) (b bytes.Buffer, err error)

Cmd runs a single command against a previously authenticated session and returns the output as a Byte buffer.

Jump to

Keyboard shortcuts

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