Skip to content

Commit

Permalink
connection: ignore errors when parsing ssh_config
Browse files Browse the repository at this point in the history
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] kevinburke/ssh_config#6

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 authored and openshift-cherrypick-robot committed Nov 18, 2024
1 parent 878f3ae commit 1795298
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/bindings/connection.go
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 1795298

Please sign in to comment.