Created
July 22, 2020 19:16
-
-
Save justmiles/6fd6a55601bcb86071611faa3f88b7d4 to your computer and use it in GitHub Desktop.
Install and configure ClamAV for Ubuntu
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
# Install ClamAV | |
sudo apt install clamav clamav-daemon moreutils | |
# Set reasonable timeouts for the virus database download | |
sudo sed -i 's/ConnectTimeout .*/ConnectTimeout 300/' /etc/clamav/freshclam.conf | |
sudo sed -i 's/ReceiveTimeout .*/ReceiveTimeout 300/' /etc/clamav/freshclam.conf | |
# Restart FreshClam | |
sudo systemctl restart clamav-freshclam | |
# Schedule a daily scan | |
cat << EOF > /tmp/clamav | |
$(which clamscan) --infected --remove --recursive /home /etc /opt /bin /usr /media /boot /lib /lib64 /root /sbin /snap /sys /tmp /var | ts '[%Y-%m-%d %H:%M:%S]' >> /var/log/clamav/clamscan.log 2>&1 | |
EOF | |
chmod +x /tmp/clamav && sudo mv /tmp/clamav /etc/cron.daily/clamav | |
# Run your first scan (this will take a while) | |
sudo /etc/cron.daily/clamav | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment