chenged Vagrantfile to create script for automating package generation
This commit is contained in:
parent
c482441d32
commit
89e52d2687
36
os/centos/stream9/Vagrantfile
vendored
36
os/centos/stream9/Vagrantfile
vendored
@ -34,43 +34,27 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=centos09
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
yum update
|
||||
yum install -y gcc openssl-devel libcurl-devel pam-devel git rapidjson-devel cmake policycoreutils-devel checkpolicy
|
||||
yum install -y gcc openssl-devel libcurl-devel pam-devel git rapidjson-devel cmake policycoreutils-devel checkpolicy rpm-build lsb-release
|
||||
|
||||
# get dependencies
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
|
||||
#handle semodule
|
||||
cd /home/vagrant/Rublon-Linux/service
|
||||
checkmodule -M -m -o login_rublon.mod login_rublon.te
|
||||
semodule_package -o login_rublon.pp -m login_rublon.mod
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B build && cmake --build build
|
||||
|
||||
# Install
|
||||
sudo cmake --install build
|
||||
sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config
|
||||
|
||||
#handle semodule
|
||||
cd /home/vagrant/Rublon-Linux/service
|
||||
semodule -i login_rublon.pp
|
||||
|
||||
# Register Rublon pam
|
||||
#grep -q -e '#auth substack password-auth' /etc/pam.d/sshd || sed -i -e 's/auth substack password-auth/#auth substack password-auth/g' /etc/pam.d/sshd
|
||||
#grep -q -e 'auth requisite pam_unix.so' /etc/pam.d/sshd || sed -i '\$aauth requisite pam_unix.so' /etc/pam.d/sshd
|
||||
#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
|
||||
|
||||
# Build project
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
|
||||
systemctl restart sshd.service
|
||||
SHELL
|
||||
end
|
||||
|
||||
|
||||
45
os/debian/11/Vagrantfile
vendored
45
os/debian/11/Vagrantfile
vendored
@ -23,7 +23,7 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.synced_folder "../../..", "/home/vagrant/Rublon-Linux"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = 1024
|
||||
vb.memory = 4048
|
||||
vb.cpus = 4
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = true
|
||||
@ -36,7 +36,9 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=debian11
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
DEBIAN_FRONTEND=noniteracactive\
|
||||
apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
@ -50,33 +52,20 @@ Vagrant.configure("2") do |config|
|
||||
cmake
|
||||
|
||||
# get dependencies
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
cmake -B socket.io-build -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release socket.io-client-cpp
|
||||
cmake --build socket.io-build --target install -- -j
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B buildir && cmake --build buildir
|
||||
|
||||
# Install
|
||||
sudo cmake --install buildir
|
||||
sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config
|
||||
|
||||
# Register Rublon pam
|
||||
SSHD_CONF=/etc/ssh/sshd_config
|
||||
SSHD_PAM_CONF=/etc/pam.d/sshd
|
||||
|
||||
grep -qe "^PasswordAuthentication" $SSHD_CONF && sed -i 's/^#*PasswordAuthentication[[:space:]]\+.*/PasswordAuthentication yes/' $SSHD_CONF || echo "PasswordAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^ChallengeResponseAuthentication" $SSHD_CONF && sed -i 's/^#*ChallengeResponseAuthentication[[:space:]]\+.*/ChallengeResponseAuthentication yes/' $SSHD_CONF || echo "ChallengeResponseAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^UsePAM" $SSHD_CONF && sed -i 's/^#*UsePAM[[:space:]]\+.*/UsePAM yes/' $SSHD_CONF || echo "UsePAM yes" >> $SSHD_CONF
|
||||
|
||||
grep -qe 'auth required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aauth required pam_rublon.so' $SSHD_PAM_CONF
|
||||
grep -qe 'account required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aaccount required pam_rublon.so' $SSHD_PAM_CONF
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
|
||||
service sshd restart
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/${BUILDDIR}/*rublon*Debian*
|
||||
SHELL
|
||||
end
|
||||
|
||||
45
os/debian/12/Vagrantfile
vendored
45
os/debian/12/Vagrantfile
vendored
@ -25,7 +25,7 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = true
|
||||
vb.memory = 1024
|
||||
vb.memory = 4044
|
||||
vb.cpus = 4
|
||||
|
||||
# Fix for 'SSH auth method: Private key' stuck
|
||||
@ -36,7 +36,9 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=debian12
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
DEBIAN_FRONTEND=noniteracactive\
|
||||
apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
@ -50,33 +52,20 @@ Vagrant.configure("2") do |config|
|
||||
cmake
|
||||
|
||||
# get dependencies
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
cmake -B socket.io-build -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release socket.io-client-cpp
|
||||
cmake --build socket.io-build --target install -- -j
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B build && cmake --build build
|
||||
|
||||
# Install
|
||||
sudo cmake --install build
|
||||
sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config
|
||||
|
||||
# Register Rublon pam
|
||||
SSHD_CONF=/etc/ssh/sshd_config
|
||||
SSHD_PAM_CONF=/etc/pam.d/sshd
|
||||
|
||||
grep -qe "^PasswordAuthentication" $SSHD_CONF && sed -i 's/^#*PasswordAuthentication[[:space:]]\+.*/PasswordAuthentication yes/' $SSHD_CONF || echo "PasswordAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^ChallengeResponseAuthentication" $SSHD_CONF && sed -i 's/^#*ChallengeResponseAuthentication[[:space:]]\+.*/ChallengeResponseAuthentication yes/' $SSHD_CONF || echo "ChallengeResponseAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^UsePAM" $SSHD_CONF && sed -i 's/^#*UsePAM[[:space:]]\+.*/UsePAM yes/' $SSHD_CONF || echo "UsePAM yes" >> $SSHD_CONF
|
||||
|
||||
grep -qe 'auth required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aauth required pam_rublon.so' $SSHD_PAM_CONF
|
||||
grep -qe 'account required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aaccount required pam_rublon.so' $SSHD_PAM_CONF
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
|
||||
service sshd restart
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/${BUILDDIR}/*rublon*Debian*
|
||||
SHELL
|
||||
end
|
||||
|
||||
58
os/rhel/9/Vagrantfile
vendored
58
os/rhel/9/Vagrantfile
vendored
@ -23,8 +23,8 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.synced_folder "../../..", "/home/vagrant/Rublon-Linux"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = 1024
|
||||
vb.cpus = 4
|
||||
vb.memory = 4024
|
||||
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = true
|
||||
|
||||
@ -36,48 +36,28 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=rhel9
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
cp ${BASE}/helpers/centos-base_9.repo /etc/yum.repos.d/centos-base_9.repo
|
||||
yum update
|
||||
yum install -y gcc openssl-devel libcurl systemd-pam git-review rapidjson-devel cmake
|
||||
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.4.tar.xz
|
||||
tar -xf git*
|
||||
cd git*
|
||||
sudo make configure
|
||||
sudo ./configure --prefix=/usr
|
||||
sudo make all
|
||||
sudo make install
|
||||
yum install -y gcc openssl-devel openssh libcurl systemd-pam git rapidjson-devel cmake rpm-build lsb-release pam-devel libcurl-devel policycoreutils
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
# get dependencies
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
|
||||
#handle semodule
|
||||
cd /home/vagrant/Rublon-Linux/service
|
||||
checkmodule -M -m -o login_rublon.mod login_rublon.te
|
||||
semodule_package -o login_rublon.pp -m login_rublon.mod
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
cmake -B socket.io-build -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release socket.io-client-cpp
|
||||
cmake --build socket.io-build --target install -- -j
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B build && cmake --build build
|
||||
# Install
|
||||
sudo cmake --install build
|
||||
sudo install -m 644 /home/vagrant/Rublon-Linux/rsc/rublon.config.defaults /etc/rublon.config
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
rpm -U ./rublon_ssh-build/rublon*.rpm
|
||||
|
||||
#handle semodule
|
||||
cd /home/vagrant/Rublon-Linux/service
|
||||
semodule -i login_rublon.pp
|
||||
|
||||
# Register Rublon pam
|
||||
sed -i 's/UsePAM .*/UsePAM yes/' /etc/ssh/sshd_config
|
||||
sed -i 's/ChallengeResponseAuthentication .*/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config
|
||||
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
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
|
||||
systemctl restart sshd.service
|
||||
SHELL
|
||||
|
||||
end
|
||||
|
||||
5
os/ubuntu/20.04/Vagrantfile
vendored
5
os/ubuntu/20.04/Vagrantfile
vendored
@ -24,7 +24,6 @@ Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = 2560
|
||||
vb.vcpu = 4
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = false
|
||||
|
||||
@ -66,12 +65,8 @@ Vagrant.configure("2") do |config|
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
|
||||
SSHD_CONF=/etc/ssh/sshd_config
|
||||
grep -qe "^PasswordAuthentication" $SSHD_CONF && sed -i 's/^#*PasswordAuthentication[[:space:]]\+.*/PasswordAuthentication yes/' $SSHD_CONF
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/${BUILDDIR}/*pam_*
|
||||
cp /home/vagrant/Rublon-Linux/rublon.config /etc/rublon.config
|
||||
service sshd restart
|
||||
SHELL
|
||||
end
|
||||
|
||||
52
os/ubuntu/22.04/Vagrantfile
vendored
52
os/ubuntu/22.04/Vagrantfile
vendored
@ -23,8 +23,7 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.synced_folder "../../..", "/home/vagrant/Rublon-Linux"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = 2560
|
||||
vb.vcpu = 4
|
||||
vb.memory = 4000
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = false
|
||||
|
||||
@ -36,7 +35,9 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=ubuntu2204
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
DEBIAN_FRONTEND=noniteracactive\
|
||||
apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
@ -49,34 +50,21 @@ Vagrant.configure("2") do |config|
|
||||
rapidjson-dev \
|
||||
cmake
|
||||
|
||||
# get dependencies
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B build && cmake --build build
|
||||
|
||||
# Install
|
||||
sudo cmake --install build
|
||||
sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config
|
||||
|
||||
# Register Rublon pam
|
||||
SSHD_CONF=/etc/ssh/sshd_config
|
||||
SSHD_PAM_CONF=/etc/pam.d/sshd
|
||||
SSHD_CONFD=/etc/ssh/sshd_config.d/60-cloudimg-settings.conf
|
||||
|
||||
grep -qe "^PasswordAuthentication" $SSHD_CONF && sed -i 's/^#*PasswordAuthentication[[:space:]]\+.*/PasswordAuthentication yes/' $SSHD_CONF
|
||||
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' $SSHD_CONFD
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
cd ./build
|
||||
make package
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/build/*pam_*
|
||||
cp /home/vagrant/Rublon-Linux/rublon.config /etc/rublon.config
|
||||
service sshd restart
|
||||
# get dependencies
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
cmake -B socket.io-build -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release socket.io-client-cpp
|
||||
cmake --build socket.io-build --target install -- -j
|
||||
ln -s /usr/bin/make /usr/bin/gmake
|
||||
# Build project
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/${BUILDDIR}/*pam_*
|
||||
SHELL
|
||||
end
|
||||
|
||||
55
os/ubuntu/24.04/Vagrantfile
vendored
55
os/ubuntu/24.04/Vagrantfile
vendored
@ -22,8 +22,7 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.synced_folder "../../..", "/home/vagrant/Rublon-Linux"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = 2560
|
||||
vb.vcpu = 4
|
||||
vb.memory = 4000
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = false
|
||||
|
||||
@ -35,7 +34,9 @@ Vagrant.configure("2") do |config|
|
||||
# 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
|
||||
|
||||
export BASE=/home/vagrant/Rublon-Linux
|
||||
export DISTRO=ubuntu2404
|
||||
export BUILDDIR=${BASE}/${DISTRO}
|
||||
DEBIAN_FRONTEND=noniteracactive\
|
||||
apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
@ -48,37 +49,21 @@ Vagrant.configure("2") do |config|
|
||||
rapidjson-dev \
|
||||
cmake
|
||||
|
||||
# get dependencies
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
mkdir socket.io-client-cpp/build; cd socket.io-client-cpp/build
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --target install
|
||||
|
||||
# Build project
|
||||
cd /home/vagrant/Rublon-Linux
|
||||
cmake -B build && cmake --build build
|
||||
|
||||
# Install
|
||||
sudo cmake --install build
|
||||
sudo install -m 644 rsc/rublon.config.defaults /etc/rublon.config
|
||||
|
||||
# Register Rublon pam
|
||||
SSHD_CONF=/etc/ssh/sshd_config
|
||||
SSHD_PAM_CONF=/etc/pam.d/sshd
|
||||
|
||||
grep -qe "^PasswordAuthentication" $SSHD_CONF && sed -i 's/^#*PasswordAuthentication[[:space:]]\+.*/PasswordAuthentication yes/' $SSHD_CONF || echo "PasswordAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^ChallengeResponseAuthentication" $SSHD_CONF && sed -i 's/^#*ChallengeResponseAuthentication[[:space:]]\+.*/ChallengeResponseAuthentication yes/' $SSHD_CONF || echo "ChallengeResponseAuthentication yes" >> $SSHD_CONF
|
||||
grep -qe "^UsePAM" $SSHD_CONF && sed -i 's/^#*UsePAM[[:space:]]\+.*/UsePAM yes/' $SSHD_CONF || echo "UsePAM yes" >> $SSHD_CONF
|
||||
|
||||
grep -qe 'auth required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aauth required pam_rublon.so' $SSHD_PAM_CONF
|
||||
grep -qe 'account required pam_rublon.so' $SSHD_PAM_CONF || sed -i '\$aaccount required pam_rublon.so' $SSHD_PAM_CONF
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
cd ./build
|
||||
make package
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/build/*pam_*
|
||||
cp /home/vagrant/Rublon-Linux/rublon.config /etc/rublon.config
|
||||
service sshd restart
|
||||
# get dependencies
|
||||
mkdir ${BUILDDIR} -p; cd ${BUILDDIR}
|
||||
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git
|
||||
cmake -B socket.io-build -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release socket.io-client-cpp
|
||||
cmake --build socket.io-build --target install -- -j
|
||||
ln -s /usr/bin/make /usr/bin/gmake
|
||||
# Build project
|
||||
cd ${BUILDDIR}
|
||||
cmake -B rublon_ssh-build ..
|
||||
cmake --build rublon_ssh-build -- -j
|
||||
cmake --build rublon_ssh-build --target package -- -j
|
||||
# Register Rublon pam
|
||||
|
||||
useradd -s /bin/bash -m bwi
|
||||
echo "bwi:bwi"|chpasswd
|
||||
sudo dpkg -i /home/vagrant/Rublon-Linux/${BUILDDIR}/*pam_*
|
||||
SHELL
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user