B
B
buddh1st2022-01-06 12:42:57
SSH
buddh1st, 2022-01-06 12:42:57

SSH access on vagrant?

Good afternoon, I ran into a problem on vagrant.
I launched 3 cars, but I can’t hook on them via SSH, it clings via vagrant ssh, but not via the standard one.
The public key cannot be copied either, it gives a permission denied error.
61d6b8e921d83754004474.png
61d6b96c207bf876816868.png
enabled passauth = yes
centos in sshd 7.
What could be the problem? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akelsey, 2022-01-06
@akelsey

Why is HostName 127.0.0.1 and not the real IP?
Upd:
Yes, and there is no public interface.
I would do like this:

ssh_pub_key = File.readlines("../../../id_rsa_vagrant.pub").first.strip

$shell_centos7 = <<-SHELL
  echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
SHELL

Vagrant.configure("2") do |config|
      ...
      nodeconfig.vm.network "public_network"
      ...
     nodeconfig.vm.provision "shell", inline: $shell_centos7
     ...

Those. I would add a public interface that will receive an IP on your network, not through NAT, and would already connect via direct IP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question