Documentation
¶
Index ¶
- func GenerateSSHKeys(dir string) ([]string, error)
- func SSHAdd(dir, sockname string, args ...string) (string, error)
- func SSHKeyGen(dir, filename string, args ...string) error
- func SSHKeyGenAdd(dir, filename, sockname string, args ...string) error
- func StartPreconfiguredAgent() (func(), string, string, error)
- func StartSSHAgent() (func(), string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSSHKeys ¶
GenerateSSHKeys generates sample ssh keys in the specified directory. The generated keys are: rsa, ecdsa-256, ecdsa-384, ecdsa-521 and ed25519.
func SSHAdd ¶
SSHAdd runs ssh-add in the specified directory to connect to the agent sockname to add the specified keys.
func SSHKeyGen ¶
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 ¶
SSHKeyGenAdd uses SSHKeyGen and SSHAdd to generate and add a key to an ssh agent.
func StartPreconfiguredAgent ¶
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 ¶
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.