As introduced in the first chapter, we're going to use Vagrant and VirtualBox for all of our work in this chapter and those going forward. This allows us to quickly provision infrastructure for testing, and saves you the manual job of creating multiple VMs each time.
If you really, really, don't want to use VirtualBox or Vagrant, then you don't have to, and I've tried to keep the examples as generic as possible, but you will probably find it much easier if you do.
I've put together the following Vagrantfile for use in this chapter:
# -*- mode: ruby -*-
# vi: set ft=ruby :
$provisionScript = <<-SCRIPT
sed -i 's#PasswordAuthentication no#PasswordAuthentication yes#g' /etc/ssh/sshd_config
systemctl restart sshd
SCRIPT
Vagrant.configure("2") do |config|
config.vm.provision "shell",
inline: $provisionScript...