Skip to content

Instantly share code, notes, and snippets.

@hieu-e
Last active March 13, 2024 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hieu-e/ca409baa8e70981afb66b5d0ce91ab2e to your computer and use it in GitHub Desktop.
Save hieu-e/ca409baa8e70981afb66b5d0ce91ab2e to your computer and use it in GitHub Desktop.
Installing ClamAV on Amazon Linux 2
#install packages
sudo yum install clamav clamd
#update virus definition
sudo freshclam
vi /etc/freshclam.conf
UpdateLogFile /var/log/freshclam.log
LogFileMaxSize 20M
LogTime yes
ogSyslog yes
LogVerbose yes
LogRotate yes
PidFile /var/run/freshclam.pid
Checks 6
ConnectTimeout 60
#update configs
vi /etc/clamd.d/scan.conf
LogFile /var/log/clamd.scan
LogFileMaxSize 20M
LogTime yes
LogSyslog yes
LogRotate yes
ExtendedDetectionInfo yes
PidFile /run/clamd.scan/clamd.pid
LocalSocket /run/clamd.scan/clamd.sock
OnAccessMaxFileSize 10M
OnAccessMaxThreads 10
OnAccessPrevention yes
OnAccessExcludeUname clamav
OnAccessIncludePath /home
OnAccessIncludePath /var
vi /etc/clamd.d/scan.conf
LogFile /var/log/clamd.scan
LogFileMaxSize 20M
LogTime yes
LogSyslog yes
LogRotate yes
ExtendedDetectionInfo yes
PidFile /run/clamd.scan/clamd.pid
LocalSocket /run/clamd.scan/clamd.sock
OnAccessMaxFileSize 10M
OnAccessMaxThreads 10
OnAccessPrevention yes
OnAccessExcludeUname clamav
OnAccessIncludePath /home
OnAccessIncludePath /var
#Add to startup and start
#enable update agent
sudo systemctl enable clamav-freshclam
sudo systemctl start clamav-freshclam
#enable scan daemon
sudo systemctl enable clamd@scan
sudo systemctl start clamd@scan
#enable onacess scanning
sudo systemctl enable clamav-clamonacc
sudo systemctl start clamav-clamonacc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment