RunSSHCommand returns the stdout, stderr, and exit code from running cmd on host as specific user, along with any SSH-level error. If user=="", it will default (like SSH) to os.Getenv("USER")
(cmd, user, host string, signer ssh.Signer)
| 175 | // host as specific user, along with any SSH-level error. |
| 176 | // If user=="", it will default (like SSH) to os.Getenv("USER") |
| 177 | func RunSSHCommand(cmd, user, host string, signer ssh.Signer) (string, string, int, error) { |
| 178 | return runSSHCommand(realTimeoutDialer, cmd, user, host, signer, true) |
| 179 | } |
| 180 | |
| 181 | // Internal implementation of runSSHCommand, for testing |
| 182 | func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer, retry bool) (string, string, int, error) { |