From c49944ea02767c12f1832752043e3760e46c668f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 14 Nov 2024 16:17:50 +0100 Subject: [PATCH] connection: ignore errors when parsing ssh_config The new ssh_Config feature doesn't work on my system because the lib fails to parse configs using Match[1]. However Fedora and RHEL based distros seem to ship /etc/ssh/ssh_config.d/50-redhat.conf which contains a Match line thus it always fails to parse and never uses the proper values from my home dir config. [1] https://github.com/kevinburke/ssh_config/issues/6 Signed-off-by: Paul Holzinger (cherry picked from commit 8a5ec2c505392588827d9dad847fd797578d0ffb) --- pkg/bindings/connection.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index 0fce6c9a27..aa29062779 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -170,6 +170,7 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec // ssh_config alias := _url.Hostname() cfg := ssh_config.DefaultUserSettings + cfg.IgnoreErrors = true found := false if val := cfg.Get(alias, "User"); val != "" { userinfo = url.User(val)