Last active
June 8, 2022 11:25
-
-
Save fredyr/115a7803d51b2944a8bc03b3b6e1ff8a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
# run script with sudo | |
# cleanup | |
apt -y autoremove | |
# update all security patches | |
apt-get -y -s dist-upgrade | grep "^Inst" | \ | |
grep -i securi | awk -F " " {'print $2'} | \ | |
xargs apt-get install | |
# install firewall and antivirus | |
apt-get -y install ufw clamav | |
# force update antivirus database | |
# needs to stop/restart daemon to run freshclam manually | |
/etc/init.d/clamav-freshclam stop | |
freshclam | |
/etc/init.d/clamav-freshclam start | |
# firewall configuration | |
ufw enable | |
ufw logging on | |
# maybe too strict? | |
ufw default allow outgoing | |
ufw default deny incoming | |
# show versions etc | |
echo | |
echo "*** Printing software versions..." | |
clamscan --version | |
ufw version && ufw status | |
# | |
# https://askubuntu.com/questions/194/how-can-i-install-just-security-updates-from-the-command-line | |
# https://www.digitalocean.com/community/tutorials/how-to-setup-a-firewall-with-ufw-on-an-ubuntu-and-debian-cloud-server | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment