ssh

package
v0.0.0-...-72560b2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KeysDir is the directory where keys are stored
	KeysDir = "./.gofn/keys"
	// PrivateKeyName is the default name of private key
	PrivateKeyName = "id_rsa"
	// PublicKeyName is the default name of public key
	PublicKeyName = "id_rsa.pub"
	// Port is the default ssh port
	Port = ":22"
)

Functions

func GenerateFNSSHKey

func GenerateFNSSHKey(bits int) (err error)

GenerateFNSSHKey func

func GenerateFingerPrint

func GenerateFingerPrint(content string) (fingerPrint string, err error)

GenerateFingerPrint based content

func GeneratePrivateKey

func GeneratePrivateKey(bits int) (privateKey *rsa.PrivateKey, err error)

GeneratePrivateKey for SSH

func GeneratePublicKey

func GeneratePublicKey(privateKey *rsa.PrivateKey) (err error)

GeneratePublicKey for SSH

func ProbeConnection

func ProbeConnection(ip string, maxRetries int) error

ProbeConnection server

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

PublicKeyFile for auth method

func WritePEM

func WritePEM(path string, content []byte, filePermission os.FileMode, dirPermission os.FileMode) (err error)

WritePEM SSH

Types

type FakeServer

type FakeServer struct {
	Cmd        string
	Reply      string
	ConnDelay  time.Duration
	ExecDelay  time.Duration
	ExitStatus int
	// contains filtered or unexported fields
}

FakeServer SSH

func NewServer

func NewServer(t *testing.T, addr, cmd, reply string, exitStatus int, execDelay, connDelay time.Duration) (server *FakeServer, err error)

NewServer creation

func (*FakeServer) Address

func (s *FakeServer) Address() (addr string)

Address server

func (*FakeServer) Stop

func (s *FakeServer) Stop()

Stop fake server

Jump to

Keyboard shortcuts

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