lavabit / robox

The tools needed to robotically create/configure/provision a large number of operating systems, for a variety of hypervisors, using packer.
633 stars 140 forks source link

Unbuntu 20.04: ssh to private_network IP no longer works #164

Closed ole-tange closed 4 years ago

ole-tange commented 4 years ago

In an earlier version of Ubuntu 20.04 the config below made it possible to:

ssh -vv vagrant@172.27.27.220

Now this no longer works.

It is unclear why, because the IP-address is set, ping works, sshd is clearly listening:

hostserver$ telnet 172.27.27.220 22
Trying 172.27.27.220...
Connected to 172.27.27.220.
Escape character is '^]'.
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4

So something happened that causes sshd to get stuck if it gets a connection on 172.27.27.220.

Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu2004"
  config.vm.network "private_network", ip: "172.27.27.220"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "512"
  end
  config.vm.provision "shell" do |s|
    ssh_pub_key = File.readlines("../../authorized_keys").first.strip
    s.inline = <<-SHELL
      mkdir /root/.ssh
      echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
      echo #{ssh_pub_key} >> /root/.ssh/authorized_keys
    SHELL
  end
end