testsshagent

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSSHKeys

func GenerateSSHKeys(dir string) ([]string, error)

GenerateSSHKeys generates sample ssh keys in the specified directory. The generated keys are: rsa, ecdsa-256, ecdsa-384, ecdsa-521 and ed25519.

func SSHAdd

func SSHAdd(dir, sockname string, args ...string) (string, error)

SSHAdd runs ssh-add in the specified directory to connect to the agent sockname to add the specified keys.

func SSHKeyGen

func SSHKeyGen(dir, filename string, args ...string) error

SSHKeyGen runs ssh-keygen in the specified directory to generate a key stored in filename, eg: SSHKeyGen(dir, "ecdsa-256", "-t", "ecdsa", "-b", "256", "-C", "ecdsa-256")

func SSHKeyGenAdd

func SSHKeyGenAdd(dir, filename, sockname string, args ...string) error

SSHKeyGenAdd uses SSHKeyGen and SSHAdd to generate and add a key to an ssh agent.

func StartPreconfiguredAgent

func StartPreconfiguredAgent() (func(), string, string, error)

StartPreconfiguredAgent starts an ssh agent and preconfigures it with the keys generated by GenerateSSHKeys. It returns a cleanup function, the socket name for the agent, the directory that the keys are created in and an error.

func StartSSHAgent

func StartSSHAgent() (func(), string, error)

StartSSHAgent starts an ssh agent and returns a cleanup function and the socket name to use for connecting to the agent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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