1

I am trying to start up a VM with this box "debian/bookworm64" but it timeouts during the ssh authentification. I've used the same Vagrantfile with ubuntu/focal64 and there it just works. I had no ssh authentification problem using the ubuntu:20.04 box, why with debian:12? But I can vagrant sshinto the VM after vagrant up timeouts. But the provision step of the Vagrantfile won't be started, which I need. I stumbled over this answer in this debian thread:

Ubuntu 20.04 "jammy" has ruby-net-ssh 6.1.0. That version is unable to connect to recent OpenSSH, as found in Debian bookworm. In Debian bullseye, ruby-net-ssh was updated to version 1:6.1.0-2+deb11u1 to fix that. Probably the same update would be needed in Ubuntu.

This is the latest version released in Ubuntu:20.04: ruby-net-ssh is already the newest version (1:5.2.0-1). Could this be the problem? Does someone else had similiar issues with a the debian/bookworm64 box or a different one?

I already tried several approaches like checking that .ssh/authorized_keys is chmod 0600 on the VM, also .vagrant.d/insecure_private_keyis in the home path of the host machine. I mean vagrant ssh works, why does the ssh authentification not work when vagrant tries to provision the new VM?

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  # config.vm.box = "ubuntu/focal64"
  config.vm.box = "debian/bookworm64"
  config.vm.hostname = "test02"

  config.vm.provider "virtualbox" do |v|
    v.name = "debian12"
    v.memory = 4096
    v.cpus = 2
  end
end

Error-Log:

D, [2023-11-07T18:03:35.124736 #896133] DEBUG -- net.ssh.authentication.session[3a9a8]: allowed methods: publickey
E, [2023-11-07T18:03:35.124763 #896133] ERROR -- net.ssh.authentication.session[3a9a8]: all authorization methods failed (tried none, publickey)

DEBUG ssh: == Net-SSH connection debug-level log END ==
 INFO ssh: SSH not ready: #<Vagrant::Errors::SSHAuthenticationFailed: SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.>

further down the log:


If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

1 Answer 1

1

Okay I finally solved it! I think the reason was ruby-net-ssh So we upgraded our server from Ubuntu 20.04 to 22.04 and vagrant up was finally running passed the ssh authentifation step to provision the VM

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .