Documentation
¶
Index ¶
- func AddKnownHost(host string, key ssh.PublicKey) error
- func AppendAuthorizedKeys(line []byte) error
- func AuthorizedKeysFile() (string, error)
- func CreateSSHDir() error
- func KnownHostsFile() (string, error)
- func NewClient(nodename string, opts ...funcopt.O) (*ssh.Client, error)
- func TrustOnFirstUseHostKeyCallback() (ssh.HostKeyCallback, error)
- func WithPort(port uint16) funcopt.O
- func WithPrivateKeyFiles(privateKeyFiles ...string) funcopt.O
- func WithTimeout(timeout time.Duration) funcopt.O
- func WithUser(user string) funcopt.O
- type AuthorizedKeysMap
- type KnownHostsMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKnownHost ¶
AddKnownHost callers must care for thread safety
func AppendAuthorizedKeys ¶
func AuthorizedKeysFile ¶
func CreateSSHDir ¶
func CreateSSHDir() error
func KnownHostsFile ¶
func TrustOnFirstUseHostKeyCallback ¶
func TrustOnFirstUseHostKeyCallback() (ssh.HostKeyCallback, error)
TrustOnFirstUseHostKeyCallback returns a host key callback checking the host keys against the known hosts file of the user, as ssh does with StrictHostKeyChecking=accept-new: the key of a host the file does not know is added to it and accepted, a key the file knows is accepted, and a key that differs from the one the file knows for the host is refused, as the host may not be the one it was.
It serves the devices om logs in to on their name alone, a SAN switch for one, where there is no key to learn from the cluster.
func WithPrivateKeyFiles ¶
WithPrivateKeyFiles specifies private key files to be added at the start of the default list of private key files.
func WithTimeout ¶
WithTimeout sets the ssh ClientConfig.Timeout (default is 10 * time.Second)
Types ¶
type AuthorizedKeysMap ¶
func GetAuthorizedKeysMap ¶
func GetAuthorizedKeysMap() (AuthorizedKeysMap, error)
type KnownHostsMap ¶
func GetKnownHostsMap ¶
func GetKnownHostsMap() (KnownHostsMap, error)