Support ProxyJump option when using ssh command (#1004)

* Add proxyjump func

* Run go mod tidy

* Run make fmt
This commit is contained in:
shopper
2020-06-17 12:15:12 +09:00
committed by GitHub
parent 4d8599e4fc
commit d9d5e612ff
3 changed files with 10 additions and 0 deletions

View File

@@ -287,6 +287,10 @@ func sshExecExternal(c conf.ServerInfo, cmd string, sudo bool) (result execResul
defaultSSHArgs = append(defaultSSHArgs, "-vvv")
}
if len(c.JumpServer) != 0 {
defaultSSHArgs = append(defaultSSHArgs, "-J", strings.Join(c.JumpServer, ","))
}
args := append(defaultSSHArgs, fmt.Sprintf("%s@%s", c.User, c.Host))
args = append(args, "-p", c.Port)
if 0 < len(c.KeyPath) {