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