#!/bin/bash set -e USER_TO_CONFIGURE="ubuntu" echo "Updating package list..." sudo apt update echo "Installing packages..." sudo apt install -y \ net-tools \ iputils-ping \ tree \ ncdu \ qemu-guest-agent \ curl \ wget \ git \ jq \ gnupg \ unzip \ ca-certificates \ build-essential \ lsof \ htop \ bash-completion \ screen \ tmux \ iftop \ traceroute \ nmap \ sysstat \ dstat \ lib32gcc-s1 \ vim \ parted \ fdisk \ lshw \ hwinfo \ chrony \ less \ mtr \ p7zip-full \ zstd \ netcat \ fail2ban \ ufw \ grc \ rkhunter \ chkrootkit \ unattended-upgrades echo "Enabling and starting qemu-guest-agent..." sudo systemctl enable qemu-guest-agent sudo systemctl start qemu-guest-agent echo "Configuring UFW firewall..." sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 22/tcp sudo ufw allow 2302:2305/udp sudo ufw --force enable echo "Enabling and starting fail2ban..." sudo systemctl enable fail2ban sudo systemctl start fail2ban echo "Updating system..." sudo apt update sudo apt upgrade -y echo "Running security scans..." sudo rkhunter --update sudo rkhunter --check --sk sudo chkrootkit echo "Setup complete. Rebooting..." sudo reboot