We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e18c92 commit 4b4a353Copy full SHA for 4b4a353
ssh/knownhosts/reader.go
@@ -6,6 +6,12 @@ import (
6
"golang.org/x/crypto/ssh"
7
)
8
9
+// NewFromReader creates a host key callback from the given OpenSSH host io.Reader
10
+// which is in SSH_KNOWN_HOSTS_FILE_FORMAT. The returned callback is for use in
11
+// ssh.ClientConfig.HostKeyCallback. By preference, the key check
12
+// operates on the hostname if available, i.e. if a server changes its
13
+// IP address, the host key check will still succeed, even though a
14
+// record of the new IP address is not available.
15
func NewFromReader(r io.Reader) (ssh.HostKeyCallback, error) {
16
db := newHostKeyDB()
17
if err := db.Read(r, ""); err != nil {
0 commit comments