Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer experienced an authentication error when trying to connect via SSH #1

Open
lestephane opened this issue Jul 26, 2020 · 3 comments

Comments

@lestephane
Copy link

When I do packer buildwith packer 1.6, I'm getting the error below. Is there some additional configuration I need to tweak?

==> ubuntu-2004: Error waiting for SSH: 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: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> ubuntu-2004: Cleaning up floppy disk...
==> ubuntu-2004: Deregistering and deleting VM...
==> ubuntu-2004: Deleting output directory...
Build 'ubuntu-2004' errored: 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: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

==> Some builds didn't complete successfully and had errors:
--> ubuntu-2004: 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: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

Note that I had to run packer fix because i was getting the error.

Error: Failed to prepare build: "ubuntu-2004"

1 error occurred:
	* Deprecated configuration key: 'iso_checksum_type'. Please call `packer fix`
against your template to update your template to be compatible with the current
version of Packer. Visit https://www.packer.io/docs/commands/fix/ for more
detail.
@mightywomble
Copy link

same

@mightywomble
Copy link

If you are finding that your packer is telling you to fix this json file you create or that while building the packer image you're getting ssh timeouts around 4 to 6 minutes in.. this json based of the original one works.
{ "builders": [ { "boot_command": [ "<enter><enter><f6><esc><wait> ", "autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/", "<enter>" ], "boot_wait": "5s", "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", "guest_os_type": "ubuntu-64", "headless": false, "http_directory": "http", "iso_checksum": "sha256:443511f6bf12402c12503733059269a2e10dec602916c0a75263e5d990f6bb93", "iso_url": "https://releases.ubuntu.com/20.04.1/ubuntu-20.04.1-live-server-amd64.iso", "memory": 2048, "name": "ubuntu-2004-root", "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "ssh_timeout": "1h1m1s", "ssh_read_write_timeout": "1h1m1s", "ssh_handshake_attempts": "200", "ssh_password": "vagrant", "ssh_username": "vagrant", "type": "virtualbox-iso", "vboxmanage": [ [ "modifyvm", "{{.Name}}", "--memory", "2048" ], [ "modifyvm", "{{.Name}}", "--cpus", "2" ] ], "virtualbox_version_file": ".vbox_version", "vm_name": "packer-ubuntu-20.04-amd64" } ], "post-processors": [ { "compression_level": "8", "output": "output/ubuntu-20.04.box", "type": "vagrant" } ], "provisioners": [ { "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", "script": "scripts/init.sh", "type": "shell" }, { "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", "script": "scripts/cleanup.sh", "type": "shell" } ] }

@mightywomble
Copy link

{
"builders": [
{
"boot_command": [
" ",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
""
],
"boot_wait": "5s",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "ubuntu-64",
"headless": false,
"http_directory": "http",
"iso_checksum": "sha256:443511f6bf12402c12503733059269a2e10dec602916c0a75263e5d990f6bb93",
"iso_url": "https://releases.ubuntu.com/20.04.1/ubuntu-20.04.1-live-server-amd64.iso",
"memory": 2048,
"name": "ubuntu-2004-root",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"ssh_timeout": "1h1m1s",
"ssh_read_write_timeout": "1h1m1s",
"ssh_handshake_attempts": "200",
"ssh_password": "vagrant",
"ssh_username": "vagrant",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
],
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-ubuntu-20.04-amd64"
}
],
"post-processors": [
{
"compression_level": "8",
"output": "output/ubuntu-20.04.box",
"type": "vagrant"
}
],
"provisioners": [
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/init.sh",
"type": "shell"
},
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/cleanup.sh",
"type": "shell"
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants