Spotter-VM/basic.sh

31 lines
1.2 KiB
Bash

#!/bin/bash
# Uninstall unnecessary packages
apt-get -y purge bsdmainutils dictionaries-common emacsen-common gnupg gnupg-agent iamerican ibritish ienglish-common installation-report ispell laptop-detect libsqlite3-0 libssl1.1 nano os-prober pinentry-curses task-english tasksel tasksel-data wamerican
# Install OpenSSH server
apt-get --no-install-recommends -y install openssh-server
cp basic/root/.ssh/authorized_keys /root/.ssh/authorized_keys
# Rename encrypted partition
sed -i 's/sda2_crypt/system/' /etc/crypttab
dmsetup rename sda2_crypt system
update-initramfs -u
# Suppress warnings during boot
cp basic/usr/share/initramfs-tools/scripts/local-top/lvm2 /usr/share/initramfs-tools/scripts/local-top/lvm2
cp basic/usr/share/initramfs-tools/scripts/local-top/cryptroot /usr/share/initramfs-tools/scripts/local-top/cryptroot
update-initramfs -u
# Set GRUB options
cp basic/etc/default/grub /etc/default/grub
update-grub
# Set legal banner with URL + latin2 character set
cp basic/etc/default/console-setup /etc/default/console-setup
cp basic/etc/issue /etc/issue
# Forbid login on tty1, disable tty2-6
cp basic/lib/systemd/system/getty@.service /lib/systemd/system/getty@.service
systemctl mask getty-static