Last active
March 19, 2021 14:43
-
-
Save amatus/268b659902983d08bf78 to your computer and use it in GitHub Desktop.
This script configures a cloud@cost debian install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
export DEBIAN_FRONTEND=noninteractive | |
export APT_LISTCHANGES_FRONTEND=none | |
mkdir -p /root/.ssh | |
echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHHuFvsgkjQBRsWgDCgI9b0rPVNbDHmTXg8+0gy3kUVb > /root/.ssh/authorized_keys | |
passwd -l root | |
deluser --remove-home user | |
cat > /etc/rc.local << EOF | |
#!/bin/sh | |
echo 600 > /sys/block/sda/device/timeout | |
EOF | |
chmod a+x /etc/rc.local | |
echo kernel.panic = 3 > /etc/sysctl.d/99-panic.conf | |
sed -i 's/errors=remount-ro/errors=panic/' /etc/fstab | |
cat > /etc/apt/sources.list << EOF | |
deb http://deb.debian.org/debian buster main | |
deb http://security.debian.org/ buster/updates main | |
EOF | |
apt-get update | |
apt-get dist-upgrade -y | |
apt-get install -y vim-tiny unattended-upgrades ntp | |
dpkg-reconfigure -plow unattended-upgrades | |
sed -i 's/.*GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=fsck.repair=yes/' /etc/default/grub | |
update-grub | |
swapoff /dev/debian-vg/swap_1 | |
lvreduce -f -L 1G /dev/debian-vg/swap_1 | |
mkswap /dev/debian-vg/swap_1 | |
swapon /dev/debian-vg/swap_1 | |
lvextend -l +100%FREE /dev/debian-vg/root | |
resize2fs /dev/debian-vg/root | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment