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

@@ -260,7 +260,9 @@ func sshExecExternal(c conf.ServerInfo, cmd string, sudo bool) (result execResul
defaultSSHArgs := []string{"-tt"}
if !conf.Conf.SSHConfig {
if 0 < len(c.SSHConfigPath) {
defaultSSHArgs = append(defaultSSHArgs, "-F", c.SSHConfigPath)
} else {
home, err := homedir.Dir()
if err != nil {
msg := fmt.Sprintf("Failed to get HOME directory: %s", err)