ssh

package
v0.0.0-...-51acebc Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyGeneration     = errors.New("Unable to generate key")
	ErrValidation        = errors.New("Unable to validate key")
	ErrPublicKey         = errors.New("Unable to convert public key")
	ErrUnableToWriteFile = errors.New("Unable to write file")
)

Functions

func GenerateSSHKey

func GenerateSSHKey(path string) error

Generate SSH keypair based on path of the private key The public key would be generated to the same path with ".pub" added

func GetSSHCommand

func GetSSHCommand(host string, port int, user string, sshKey string, args ...string) *exec.Cmd

func GetSSHCommandWithSSHPass

func GetSSHCommandWithSSHPass(host string, port int, user string, passwd string, args ...string) *exec.Cmd

func WaitForTCP

func WaitForTCP(addr string) error

Types

type KeyPair

type KeyPair struct {
	PrivateKey []byte
	PublicKey  []byte
}

func NewKeyPair

func NewKeyPair() (keyPair *KeyPair, err error)

Generate a new SSH keypair This will return a private & public key encoded as DER.

func (*KeyPair) Fingerprint

func (kp *KeyPair) Fingerprint() string

Calculate the fingerprint of the public key

func (*KeyPair) WriteToFile

func (kp *KeyPair) WriteToFile(privateKeyPath string, publicKeyPath string) error

Write keypair to files

Jump to

Keyboard shortcuts

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