Fix SSH failure due to .ssh/config owner (#1005)

* use -F option, success configtest and scan

* add sshConfigPath in config.toml

* Use sshConfigPath in config.toml when using ssh -F

* change -ssh-config to deprecated

* fix typo

* add sshConfigPath in tomltemplate
This commit is contained in:
Norihiro NAKAOKA
2020-06-16 05:48:31 +09:00
committed by GitHub
parent 996557c667
commit 59c7061d29
6 changed files with 33 additions and 4 deletions

View File

@@ -1036,6 +1036,7 @@ type ServerInfo struct {
User string `toml:"user,omitempty" json:"user,omitempty"`
Host string `toml:"host,omitempty" json:"host,omitempty"`
Port string `toml:"port,omitempty" json:"port,omitempty"`
SSHConfigPath string `toml:"sshConfigPath,omitempty" json:"sshConfigPath,omitempty"`
KeyPath string `toml:"keyPath,omitempty" json:"keyPath,omitempty"`
KeyPassword string `json:"-,omitempty" toml:"-"`
CpeNames []string `toml:"cpeNames,omitempty" json:"cpeNames,omitempty"`

View File

@@ -77,6 +77,11 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) error {
}
}
s.SSHConfigPath = v.SSHConfigPath
if len(s.SSHConfigPath) == 0 {
s.SSHConfigPath = d.SSHConfigPath
}
s.KeyPath = v.KeyPath
if len(s.KeyPath) == 0 {
s.KeyPath = d.KeyPath