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]>
(cherry picked from commit 8a5ec2c)
  • Loading branch information
Luap99 committed Nov 19, 2024
1 parent f7877bf commit c49944e
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
Expand Up @@ -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)
Expand Down

0 comments on commit c49944e

Please sign in to comment.