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

"vagrant up" SSH Authentication Failure, but "vagrant ssh" Works #12418

Closed
DirectRoot opened this issue Jun 11, 2021 · 3 comments
Closed

"vagrant up" SSH Authentication Failure, but "vagrant ssh" Works #12418

DirectRoot opened this issue Jun 11, 2021 · 3 comments

Comments

@DirectRoot
Copy link

DirectRoot commented Jun 11, 2021

Vagrant version

Vagrant 2.2.16

Host operating system

macOS BigSur on Apple M1

Guest operating system

Ubuntu Focal (Docker)

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.provider "docker" do |d|
    d.build_dir = "."
    d.name = "cpcm-prometheus"
    d.has_ssh = true
    config.ssh.private_key_path = "./ssh/vagrant.pem"
    config.ssh.username = "root"
  end
end

Dockerfile

FROM ubuntu:focal

RUN apt update && apt install -y openssh-server \
    vim \
    iproute2 \
    netcat

COPY ssh/demo.conf /etc/ssh/sshd_config.d/
RUN mkdir /root/.ssh
COPY ssh/vagrant.pem.pub /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/authorized_keys

RUN service ssh start
EXPOSE 22

CMD ["/usr/sbin/sshd","-D"]

Debug output

https://gist.github.com/DirectRoot/9f04f9d6f1e295fc214879eb87a3184a

Expected behavior

vagrant up completes

Actual behavior

vagrant up does not complete because of an authentication failure, but when cancelled vagrant ssh works. I have also manually used the ssh command to connect to the container.

Steps to reproduce

  1. ssh-keygen -b 4096 -C vagrant -f ./ssh/vagrant.pem
  2. vagrant up
  3. Ctrl+c
  4. vagrant ssh

References

Reading through other issues I suspect the problem is with the net-ssh library, but I'm not big enough on Ruby to debug.

@chrisroberts
Copy link
Member

Hi there, thanks for reporting this issue. This has already been reported here: #12344 so I'm going to close this as a duplicate.

Cheers!

@DirectRoot
Copy link
Author

@chrisroberts you're my hero for responding so quick. I did not correlate these two issues 👍

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants