From c548ec8b04967f8b637aed7d9146873124a0cf21 Mon Sep 17 00:00:00 2001 From: rublon-mmz <139967271+rublon-mmz@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:52:01 +0200 Subject: [PATCH] Adding OS for testing (#1) * Adding OS for testing * Shortening bash commands and adding vagrant files to gitignore * Removing rapidjson package and adding debian 12 os --- .gitignore | 3 ++ os/centos/stream9/Vagrantfile | 63 +++++++++++++++++++++++++++++++++ os/debian/11/Vagrantfile | 65 +++++++++++++++++++++++++++++++++++ os/debian/12/Vagrantfile | 60 ++++++++++++++++++++++++++++++++ os/ubuntu/20.04/Vagrantfile | 60 ++++++++++++++++++++++++++++++++ os/ubuntu/22.04/Vagrantfile | 62 +++++++++++++++++++++++++++++++++ 6 files changed, 313 insertions(+) create mode 100644 os/centos/stream9/Vagrantfile create mode 100644 os/debian/11/Vagrantfile create mode 100644 os/debian/12/Vagrantfile create mode 100644 os/ubuntu/20.04/Vagrantfile create mode 100644 os/ubuntu/22.04/Vagrantfile diff --git a/.gitignore b/.gitignore index 4a0b530..c377977 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,6 @@ CMakeLists.txt.user* *.dll *.exe +#Vagrant generated files +*.vagrant + diff --git a/os/centos/stream9/Vagrantfile b/os/centos/stream9/Vagrantfile new file mode 100644 index 0000000..625eb58 --- /dev/null +++ b/os/centos/stream9/Vagrantfile @@ -0,0 +1,63 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#Default user +#---------------------- +#login: vagrant +#pass: vagrant +Vagrant.configure("2") do |config| + + #Basic configuration + config.vm.provider "virtualbox" + config.vm.box = "generic/centos9s" + config.ssh.forward_agent = true + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + + yum update + yum install -y gcc openssl-devel curl-devel pam-devel git cmake + + sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config + sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + git clone git@github.com:Rublon/rublon-ssh-cpp-private.git + + cd rublon-ssh-cpp-private/ + + #Temporary solution due to missing CMakeLists files in .../rapidjson and .../tl + touch PAM/ssh/extern/rapidjson/CMakeLists.txt + + #Building project + mkdir build + cd build/ + cmake .. + cmake --build . + + grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd + grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd + + + systemctl restart sshd.service + #service sshd restart - doesnt work + SHELL + + +end + diff --git a/os/debian/11/Vagrantfile b/os/debian/11/Vagrantfile new file mode 100644 index 0000000..b3aa8b9 --- /dev/null +++ b/os/debian/11/Vagrantfile @@ -0,0 +1,65 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#Default user +#---------------------- +#login: root +#pass: vagrant + +#Default files location +#---------------------- +# +#/home/vagrant +Vagrant.configure("2") do |config| + + #Basic configuration + config.vm.provider "virtualbox" + config.vm.box = "debian/bullseye64" + config.ssh.forward_agent = true + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + + DEBIAN_FRONTEND=noniteracactive\ + apt-get update && apt-get install -y \ + gcc build-essential openssh-server libcurl4-openssl-dev\ + libpam0g-dev libssl-dev cmake git + + sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config + sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + git clone git@github.com:Rublon/rublon-ssh-cpp-private.git + + cd rublon-ssh-cpp-private/ + + #Temporary solution due to missing CMakeLists files in .../rapidjson and .../tl + touch PAM/ssh/extern/rapidjson/CMakeLists.txt + + #Building project + mkdir build + cd build/ + cmake .. + cmake --build . + + grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd + grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd + + service sshd restart + SHELL +end diff --git a/os/debian/12/Vagrantfile b/os/debian/12/Vagrantfile new file mode 100644 index 0000000..045d94c --- /dev/null +++ b/os/debian/12/Vagrantfile @@ -0,0 +1,60 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#Default +# +#login: root +#pass: vagrant +Vagrant.configure("2") do |config| + + #Basic configuration + config.vm.provider "virtualbox" + config.vm.box = "debian/bookworm64" + config.ssh.forward_agent = true + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + + DEBIAN_FRONTEND=noniteracactive\ + apt-get update && apt-get install -y \ + gcc build-essential openssh-server libcurl4-openssl-dev\ + libpam0g-dev libssl-dev cmake git + + sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config + sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + git clone git@github.com:Rublon/rublon-ssh-cpp-private.git + + cd rublon-ssh-cpp-private/ + + #Temporary solution due to missing CMakeLists files in .../rapidjson and .../tl + touch PAM/ssh/extern/rapidjson/CMakeLists.txt + + #Building project + mkdir build + cd build/ + cmake .. + cmake --build . + + grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd + grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd + + service sshd restart + SHELL +end diff --git a/os/ubuntu/20.04/Vagrantfile b/os/ubuntu/20.04/Vagrantfile new file mode 100644 index 0000000..76c4819 --- /dev/null +++ b/os/ubuntu/20.04/Vagrantfile @@ -0,0 +1,60 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#Default user +#---------------------- +#login: vagrant +#pass: vagrant +Vagrant.configure("2") do |config| + + #Basic configuration + config.vm.provider "virtualbox" + config.vm.box = "ubuntu/focal64" + config.ssh.forward_agent = true + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + + DEBIAN_FRONTEND=noniteracactive\ + apt-get update && apt-get install -y \ + gcc build-essential openssh-server libcurl4-openssl-dev\ + libpam0g-dev libssl-dev cmake + + sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config + sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + git clone git@github.com:Rublon/rublon-ssh-cpp-private.git + + cd rublon-ssh-cpp-private/ + + #Temporary solution due to missing CMakeLists files in .../rapidjson and .../tl + touch PAM/ssh/extern/rapidjson/CMakeLists.txt + + #Building project + mkdir build + cd build/ + cmake .. + cmake --build . + + grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd + grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd + + service sshd restart + SHELL +end diff --git a/os/ubuntu/22.04/Vagrantfile b/os/ubuntu/22.04/Vagrantfile new file mode 100644 index 0000000..28f1204 --- /dev/null +++ b/os/ubuntu/22.04/Vagrantfile @@ -0,0 +1,62 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#Default user +#---------------------- +#login: vagrant +#pass: vagrant +Vagrant.configure("2") do |config| + + #Basic configuration + config.vm.provider "virtualbox" + config.vm.box = "ubuntu/jammy64" + config.ssh.forward_agent = true + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + + DEBIAN_FRONTEND=noniteracactive\ + apt-get update && apt-get install -y \ + gcc build-essential openssh-server libcurl4-openssl-dev\ + libpam0g-dev libssl-dev cmake + + + sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config + sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + git clone git@github.com:Rublon/rublon-ssh-cpp-private.git + + cd rublon-ssh-cpp-private/ + + #Temporary solution due to missing CMakeLists files in .../rapidjson and .../tl + touch PAM/ssh/extern/rapidjson/CMakeLists.txt + + #Building project + mkdir build + cd build/ + cmake .. + cmake --build . + + grep -q -e 'auth required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aauth required pam_rublon.so' /etc/pam.d/sshd + grep -q -e 'account required pam_rublon.so' /etc/pam.d/sshd || sed -i '\$aaccount required pam_rublon.so' /etc/pam.d/sshd + + service sshd restart + SHELL + +end