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.
2 parents 7496b3d + 2da8235 commit 73fe362Copy full SHA for 73fe362
git/ssh_config.go
@@ -6,6 +6,8 @@ import (
6
"path/filepath"
7
"regexp"
8
"strings"
9
+
10
+ "github.com/mitchellh/go-homedir"
11
)
12
13
const (
@@ -15,12 +17,16 @@ const (
15
17
type SSHConfig map[string]string
16
18
19
func newSSHConfigReader() *SSHConfigReader {
20
+ configFiles := []string{
21
+ "/etc/ssh_config",
22
+ "/etc/ssh/ssh_config",
23
+ }
24
+ if homedir, err := homedir.Dir(); err == nil {
25
+ userConfig := filepath.Join(homedir, ".ssh", "config")
26
+ configFiles = append([]string{userConfig}, configFiles...)
27
28
return &SSHConfigReader{
- Files: []string{
- filepath.Join(os.Getenv("HOME"), ".ssh/config"),
- "/etc/ssh_config",
- "/etc/ssh/ssh_config",
- },
29
+ Files: configFiles,
30
}
31
32
0 commit comments