- c.cmd = exec.Command("ssh", remote, "/bin/sh", opts)
- c.remote = remote
+
+ c.sshRemote = remote
+ if sshConfig != "" {
+ c.sshOpts = []string{"-F", sshConfig}
+ }
+ c.cmd = exec.Command("ssh",
+ append(append([]string{}, c.sshOpts...),
+ c.sshRemote, "/bin/sh", opts)...)