AlmaLinux9.2 アンチウィルス(Clamav) のインストール方法
環境
AlmaLinux release 9.2 (Turquoise Kodkod)
操作方法
1.Clam AntiVirusをインストールする
# dnf -y install clamav clamd clamav-update
2.Clam AntiVirus設定ファイルを編集する
# vi /etc/clamd.d/scan.conf
/**14行目*/
# Default: disabled
LogFile /var/log/clamd.scan ← コメント解除
/**77行目*/
# Default: disabled
PidFile /run/clamd.scan/clamd.pid ← コメント解除
/**97行目 追加*/
# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
#LocalSocket /run/clamd.scan/clamd.sock
LocalSocket /var/run/clamd.scan/clamd.sock
/**219行目*/
# Run as another user (clamd must be started by root for this option to work)
# Default: don't drop privileges
#User clamscan ← 行頭に#を追加してコメントアウト
/**14行目*/
# Default: disabled
LogFile /var/log/clamd.scan ← コメント解除
/**77行目*/
# Default: disabled
PidFile /run/clamd.scan/clamd.pid ← コメント解除
/**97行目 追加*/
# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
#LocalSocket /run/clamd.scan/clamd.sock
LocalSocket /var/run/clamd.scan/clamd.sock
/**219行目*/
# Run as another user (clamd must be started by root for this option to work)
# Default: don't drop privileges
#User clamscan ← 行頭に#を追加してコメントアウト
/**14行目*/ # Default: disabled LogFile /var/log/clamd.scan ← コメント解除 /**77行目*/ # Default: disabled PidFile /run/clamd.scan/clamd.pid ← コメント解除 /**97行目 追加*/ # Path to a local socket file the daemon will listen on. # Default: disabled (must be specified by a user) #LocalSocket /run/clamd.scan/clamd.sock LocalSocket /var/run/clamd.scan/clamd.sock /**219行目*/ # Run as another user (clamd must be started by root for this option to work) # Default: don't drop privileges #User clamscan ← 行頭に#を追加してコメントアウト
3.ウイルス定義ファイル更新を設定する
# vi /etc/freshclam.conf
/**75行目*/
「DatabaseMirror database.clamav.net」の行頭に「#」を挿入し、
「DatabaseMirror db.jp.clamav.net」を追加
#DatabaseMirror database.clamav.net
DatabaseMirror db.jp.clamav.net
/**75行目*/
「DatabaseMirror database.clamav.net」の行頭に「#」を挿入し、
「DatabaseMirror db.jp.clamav.net」を追加
#DatabaseMirror database.clamav.net
DatabaseMirror db.jp.clamav.net
/**75行目*/ 「DatabaseMirror database.clamav.net」の行頭に「#」を挿入し、 「DatabaseMirror db.jp.clamav.net」を追加 #DatabaseMirror database.clamav.net DatabaseMirror db.jp.clamav.net
/**151 行目*/
「NotifyClamd /etc/clamd.d/scan.conf」を追加する
#NotifyClamd /path/to/clamd.conf
NotifyClamd /etc/clamd.d/scan.conf
/**151 行目*/
「NotifyClamd /etc/clamd.d/scan.conf」を追加する
#NotifyClamd /path/to/clamd.conf
NotifyClamd /etc/clamd.d/scan.conf
/**151 行目*/ 「NotifyClamd /etc/clamd.d/scan.conf」を追加する #NotifyClamd /path/to/clamd.conf NotifyClamd /etc/clamd.d/scan.conf
4.ウイルス定義ファイル最新化
# freshclam
5.Clam AntiVirusを起動する
# systemctl start clamd@scan ← clamd起動
# systemctl enable clamd@scan ← clamd自動起動設定
# systemctl is-enabled clamd@scan
enabled
# systemctl status clamd@scan ← 動作確認
# systemctl start clamd@scan ← clamd起動
# systemctl enable clamd@scan ← clamd自動起動設定
# systemctl is-enabled clamd@scan
enabled
# systemctl status clamd@scan ← 動作確認
# systemctl start clamd@scan ← clamd起動 # systemctl enable clamd@scan ← clamd自動起動設定 # systemctl is-enabled clamd@scan enabled # systemctl status clamd@scan ← 動作確認
6.ウィスルスキャンを実施する
# wget http://www.eicar.org/download/eicar.com
# clamscan --infected --remove --recursive
# wget http://www.eicar.org/download/eicar.com
# clamscan --infected --remove --recursive
# wget http://www.eicar.org/download/eicar.com # clamscan --infected --remove --recursive