eurobsdcon22/provision-openbsd.sh
Samuel Aubertin b7fc6a248f init
2022-09-14 12:56:21 +02:00

23 lines
695 B
Bash

#!/bin/sh
set -e
set +x
(
echo MAGMA : Starting packer provisioning.
sysctl -n kern.version
printf 'permit nopass :wheel\n' > /etc/doas.conf
printf 'PasswordAuthentication yes\nPermitRootLogin yes\n' >> /etc/ssh/sshd_config
echo Cleaning SSH keys
rm -f /etc/ssh/ssh_host*
echo Cleaning caches
find /var/log -type f | while read f; do echo -ne '' > $f; done
find /tmp -type f | while read f; do echo -ne '' > $f; done
#echo Filling /EMPTY with zeroes...
#dd if="/dev/zero" of="/EMPTY" bs=4096 > /dev/null 2>&1 || rm -f "/EMPTY"
sync
sync
echo Packer provisionning done.
)
exit 0