sshutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNewSSHKeys

func GenerateNewSSHKeys() ([]byte, []byte, error)

GenerateNewSSHKeys generates a new SSH key pair

func IsResponding

func IsResponding(ip string) bool

Check if host is responding

Types

type SSHClient

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

SSHClient is a wrapper around the ssh.Client

func NewClient

func NewClient(host string, user string, privKeyFile string) (*SSHClient, error)

NewClient creates a new SSHClient

func (*SSHClient) RunAsSudo

func (c *SSHClient) RunAsSudo(command string) error

RunAsSudo runs a command as sudo on the remote host

func (*SSHClient) RunAsUser

func (c *SSHClient) RunAsUser(command string) error

RunAsUser runs a command as the user on the remote host

Jump to

Keyboard shortcuts

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