NewRemoteCommand returns an exec.Cmd that will securely run a shell command on the remote machine.
(ctx context.Context, tunnelPort int, destination string, sshArgs ...string)
| 51 | // NewRemoteCommand returns an exec.Cmd that will securely run a shell |
| 52 | // command on the remote machine. |
| 53 | func NewRemoteCommand(ctx context.Context, tunnelPort int, destination string, sshArgs ...string) (*exec.Cmd, error) { |
| 54 | sshArgs, command, err := ParseSSHArgs(sshArgs) |
| 55 | if err != nil { |
| 56 | return nil, err |
| 57 | } |
| 58 | |
| 59 | cmd, _, err := newSSHCommand(ctx, tunnelPort, destination, sshArgs, command) |
| 60 | return cmd, err |
| 61 | } |
| 62 | |
| 63 | // newSSHCommand populates an exec.Cmd to run a command (or if blank, |
| 64 | // an interactive shell) over ssh. |
no test coverage detected