hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

Error on host key detection on some boxes #13271

Closed LKHN closed 5 months ago

LKHN commented 8 months ago

Considering the ssh-ed25519 is supported, the new supports_key_type? method returns ssh-rsa on some boxes. I can observe the issue on the generic/rocky8 and generic/rhel8 boxes but It successfully identifies the ssh-ed25519 as supported on almalinux/8 box.

Debug output

:host_key=>["rsa-sha2-512", "rsa-sha2-256", "ssh-rsa"]

Expected behavior

Box: almalinux/8

Since we can see the ssh-ed25519 listed on the output of this command:

$ sudo sshd -T | grep -Ei '^hostkeyalgorithms'
hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa

It should be listed and the new ssh keypair is generated in ssh-ed255519:

:host_key=>["rsa-sha2-512", "rsa-sha2-256", "ssh-rsa", "ecdsa-sha2-nistp256", "ssh-ed25519"]

Reproduction information

Vagrant version

2.3.8.dev+000134-ba10fe9e

Plugins:

Host operating system

AlmaLinux OS 9.2

Guest operating system

Rocky Linux 8.8, RHEL 8.8.

Steps to reproduce

  1. vagrant init generic/rocky8
  2. vagrant up --debug
  3. Check out the output for :host_key

Vagrantfile

Default: vagrant init generic/rocky8