From 85de1d06373bcf286a308b16700261efeb031151 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 27 Sep 2019 11:12:53 -0700 Subject: [PATCH] make friendlier message warning user that their creds may be wrong --- helper/communicator/step_connect_ssh.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 3d806672e..07763e335 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -215,6 +215,12 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, ctx context.Contex if strings.Contains(err.Error(), "authenticate") { log.Printf( "[DEBUG] Detected authentication error. Increasing handshake attempts.") + err = fmt.Errorf("Packer experienced an authentication error "+ + "when trying to connect via SSH. This can happen if your "+ + "username/password are wrong. You may want to double-check"+ + " your credentials as part of your debugging process. "+ + "original error: %s", + err) handshakeAttempts += 1 }