make friendlier message warning user that their creds may be wrong

This commit is contained in:
Megan Marsh 2019-09-27 11:12:53 -07:00
parent eccf0fb51d
commit 85de1d0637
1 changed files with 6 additions and 0 deletions

View File

@ -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
}