Documentation ¶
Index ¶
- func AddKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (err error)
- func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (found bool, err error)
- func DefaultKnownHosts() (ssh.HostKeyCallback, error)
- func DefaultKnownHostsPath() (string, error)
- func KnownHosts(file string) (ssh.HostKeyCallback, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKnownHost ¶
AddKnownHost add a a host to known hosts file.
func CheckKnownHost ¶
func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (found bool, err error)
CheckKnownHost checks is host in known hosts file. it returns is the host found in known_hosts file and error, if the host found in known_hosts file and error not nil that means public key mismatch, maybe MAN IN THE MIDDLE ATTACK! you should not handshake.
func DefaultKnownHosts ¶
func DefaultKnownHosts() (ssh.HostKeyCallback, error)
DefaultKnownHosts returns host key callback from default known hosts path, and error if any.
func DefaultKnownHostsPath ¶
DefaultKnownHostsPath returns default user knows hosts file.
func KnownHosts ¶
func KnownHosts(file string) (ssh.HostKeyCallback, error)
KnownHosts returns host key callback from a custom known hosts path.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.