internal_ssh

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKnownHost

func AddKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownHostsFile string) (err error)

func CheckKnownHost

func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownHostsFile string) (found bool, err error)

func DefaultKnownHosts

func DefaultKnownHosts() (ssh.HostKeyCallback, error)

func DefaultKnownHostsPath

func DefaultKnownHostsPath() (string, error)

func Download

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

func GetSigner

func GetSigner(privateKeyPath, passphrase string) (signer ssh.Signer, err error)

func HasAgent

func HasAgent() bool

func NewSFTPClient

func NewSFTPClient(c *ssh.Client) (*sftp.Client, error)

func NewSSHClient

func NewSSHClient(host, user string, port int, auth Auth) (*ssh.Client, error)

func Run

func Run(command string, c *ssh.Client) error

func Shell

func Shell(c *ssh.Client) (err error)

func Upload

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

func VerifyHost

func VerifyHost(host string, remote net.Addr, key ssh.PublicKey) error

Types

type Auth

type Auth []ssh.AuthMethod

func GetAgent

func GetAgent() (Auth, error)

func GetAuth

func GetAuth(keyfile string) (auth Auth, err error)

func Key

func Key(privateKeyPath, passphrase string) (Auth, error)

func Password

func Password(password string) Auth

Jump to

Keyboard shortcuts

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