From 3863f34fc082544e68ecc91292f23c6ab98929a2 Mon Sep 17 00:00:00 2001 From: Andrew Woodlee Date: Mon, 2 Jan 2023 17:41:42 -0600 Subject: [PATCH] base64 encoding for host --- pkg/backy/ssh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/backy/ssh.go b/pkg/backy/ssh.go index d5c473b..a68336c 100644 --- a/pkg/backy/ssh.go +++ b/pkg/backy/ssh.go @@ -2,6 +2,7 @@ package backy import ( "bufio" + "encoding/base64" "errors" "fmt" "log" @@ -140,7 +141,7 @@ func getHostKey(host string) ssh.PublicKey { if len(fields) != 3 { continue } - if strings.Contains(fields[0], host) { + if strings.Contains(fields[0], base64.StdEncoding.EncodeToString([]byte(host))) { var err error hostKey, _, _, _, err = ssh.ParseAuthorizedKey(scanner.Bytes()) if err != nil {