From ec9e50ff933b9bb2d32a908a1c149f252b0730c7 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Tue, 19 Jul 2022 16:55:14 -0700 Subject: [PATCH] Always set PasswordAuthentication option --- internal/codespaces/ssh.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/codespaces/ssh.go b/internal/codespaces/ssh.go index 0c81c4f32..9a146c4f6 100644 --- a/internal/codespaces/ssh.go +++ b/internal/codespaces/ssh.go @@ -56,7 +56,11 @@ 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) { - connArgs := []string{"-p", strconv.Itoa(port), "-o", "NoHostAuthenticationForLocalhost=yes"} + connArgs := []string{ + "-p", strconv.Itoa(port), + "-o", "NoHostAuthenticationForLocalhost=yes", + "-o", "PasswordAuthentication=no", + } // The ssh command syntax is: ssh [flags] user@host command [args...] // There is no way to specify the user@host destination as a flag. @@ -101,6 +105,7 @@ func newSCPCommand(ctx context.Context, port int, dst string, cmdArgs []string) connArgs := []string{ "-P", strconv.Itoa(port), "-o", "NoHostAuthenticationForLocalhost=yes", + "-o", "PasswordAuthentication=no", "-C", // compression }