Add key to RPC call

This commit is contained in:
JP Ungaretti 2022-05-26 21:45:20 +00:00 committed by GitHub
parent 77507cd94c
commit 76090a2ea7
3 changed files with 13 additions and 4 deletions

View file

@ -56,6 +56,7 @@ func NewRemoteCommand(ctx context.Context, tunnelPort int, destination string, s
// newSSHCommand populates an exec.Cmd to run a command (or if blank,
// an interactive shell) over ssh.
func newSSHCommand(ctx context.Context, port int, dst string, cmdArgs []string) (*exec.Cmd, []string, error) {
// TODO: Read SSH key from ~/.ssh/codespace and pass as argument with -i
connArgs := []string{"-p", strconv.Itoa(port), "-o", "NoHostAuthenticationForLocalhost=yes"}
// The ssh command syntax is: ssh [flags] user@host command [args...]