Documentation
¶
Index ¶
- func NewClient(user, target string, opts ...option) (*sshClient, error)
- func SetCipher(cipher string) option
- func SetHostKeyCallback(knownhostsFile string) option
- func SetKey(keyfile string) option
- func SetKeyExchange(key string) option
- func SetPassword(pw string) option
- func SetPort(port string) option
- func SetTimeout(timeout time.Duration) option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient is a factory function that takes in a a username, a target in the form of an IP or a hostname, and potentially options.
func SetCipher ¶
func SetCipher(cipher string) option
SetCipher updates the list of cipher algorithms. Common examples include:
- aes128-ctr
- aes192-ctr
- aes256-ctr
- 3des-cbc
func SetHostKeyCallback ¶
func SetHostKeyCallback(knownhostsFile string) option
SetHostKeyCallback takes in a known hosts file, usually an absolute path, and applies it to the client as an option to protect against man-in-the-middle attacks.
func SetKey ¶
func SetKey(keyfile string) option
SetKey takes in private key file, usually an absolute path, and applies it to the client as an option.
func SetKeyExchange ¶
func SetKeyExchange(key string) option
SetKeyExchange updates the list of key exchange algorithms. Common examples include:
- diffie-hellman-group1-sha1
- diffie-hellman-group14-sha256
- curve25519-sha256
func SetPort ¶
func SetPort(port string) option
SetPort applies a port to the client. If not set, the default port of 22 is applied.
func SetTimeout ¶
SetTimeout applies a timeout in seconds for the client connection.
Types ¶
This section is empty.