このページではLinux用のアンチウィルスソフトとして有名な(AntiVir)の導入から設定方法を解説しています。

vinelinuxで自宅サーバー公開ロゴ
サイトマップ

>>Linuxで自宅サーバー公開(TOP) >>アンチウィルス(AntiVir)の導入


アンチウィルス(AntiVir)の導入


AntiVirの導入手順




※見たい項目をクリックすると説明にジャンプします。

 

 
AntiVirとは?  
  AntiVirとは、リナックスだけではなく、ウィンドウズなどにも対応しているアンチウィルスソフトです。
 クライアントのみならず、サーバー側でもウィルス対策できるのはうれしいですね。
 AntiVirは、個人(非商用)に限って無料で使用できることもあり、サーバーマシン(Linux)
 に導入してみました。設定も比較的容易ですので試してみるのもいいかもしれません。
 ※企業(商用)でお使いの場合は有償となりますのでご注意ください。

 ▲AntiVirの設定手順へ


 AntiVirのダウンロード
  最新版をホームページよりダウンロードします。
  ・"Download"をクリックしてダウンロードページへ移動します。
 

  ・インストール対象のファイル(Linux版)ダウンロードします。
  

  ダウンロードしたファイル(antivir-workstation-pers.tar.gz)をFTPソフトでサーバー側
  アップロードします。
  

  ・tarコマンドでファイルを展開します。
[root@]# tar zxf antivir-workstation-pers.tar.gz     [return]
 
  以上でインストールする準備が整いました。早速インストールしてみましょう。

 ▲AntiVirの設定手順へ


 AntiVirのインストール&設定
  まずは展開先のディレクトリ(antivir-workstation-pers...)へ移動します。
 インストールスクリプトによりをインストール実行します。
 ※対話形式ですので順に説明します。

[root@]# ./install     [return]   <-インストールコマンドを実行

環境によって、以下のようなエラーメッセージが表示される場合があります。
----------------------------------------

Not all the required tools were found. Please install
the following tools:
which

----------------------------------------

--------<対策方法> --------
vi install  [return] viエディタで"install"(スクリプト)を開きます。
"/whichi" whichiを検索します。
↓以下の記述部分を探してください。(116行目あたり?)
if [ ! -x "`
which $EXEITEM`" ]  (変更前)
if [ ! -x "`
/usr/bin/which $EXEITEM`" ]  (変更後)
上記変更を保存(:wq)して再度実行(./install)してみてください。
---------------------------
※Vine2.6のときは発生しなかった?気がしますが
 Vine3.2環境では、上記現象がでました。

↓インストールが開始されると以下のようなメッセージが表示されます。


Starting AntiVir for UNIX Workstation 2.1.5-24 installation...

Before installing this software, you must agree to the terms
of the license.

Use the arrow keys to scroll through the license. When you
are finished reading, press 'q' to exit the viewer.

Press <ENTER> to view the license.
ライセンスファイルを読みます。(スペースキーで画面が進みます)
・・・(省略)
Do you agree to the license terms? [n] y  <-ライセンスに同意
・・・(省略)

Enter the path to your key file: [hbedv.key]   <-ライセンスキーを選択
・・・(省略)
How should AvGuard be installed? [n]  
<-リアルタイムスキャンは設定しない
・・・(省略)
Would you like to install the GUI (+ SMC support)? [n] 
↑サーバー用なのでGUIはインストールしない
・・・(省略)
Would you like to configure AntiVir now? [y]  <-AntiVirの設定を行なう
・・・(省略)
How often should AntiVir check for updates? [d]
<-AntiVirのアップデート周期(日毎)
・・・(省略)
What time should updates be done? [02:00]  <-アップデート時間を指定
・・・(省略)
Would you like email notification of alerts? [y] <-ウィルス警告メールを受信?
・・・(省略)
What email address will receive notifications? [root] <-メールアドレスを指定
・・・(省略)
Would you like AntiVir to log to a custom file? [y] <-ログファイルを指定?
・・・(省略)
hat will be the log file name with absolute path (it must begin with '/')
? [/var/log/antivir.log] 
<-ログファイルの指定
・・・(省略)
Does this machine use an HTTP proxy server? [n] <-プロキシを指定?
・・・(省略)
Which syslog FACILITY should AntiVir use? [uucp] <-syslog(出力元)を指定
・・・(省略)
Which syslog PRIORITY should AntiVir use? [notice] <-syslog(優先レベル)を指定
・・・(省略)
Save configuration settings? [y] 
<-設定を保存?
・・・(省略)
Would you like to restart the updater using the new configuration? [y] 
↑再起動(設定反映)?
・・・(省略)
Configuration Complete
======================

email notification: root
specific logfile: /var/log/antivir.log
update frequency: daily (if avupdater is running)
update time: 01:00 (if avupdater is running)
syslog output: uucp.notice
Press <ENTER> to continue.<-設定を確認して[ENTER]
・・・(省略)
AntiVir
=======
configure: /usr/lib/AntiVir/configantivir

Automatic Internet Updater
==========================
start: /usr/lib/AntiVir/avupdater start
stop: /usr/lib/AntiVir/avupdater stop
check: /usr/lib/AntiVir/avupdater status
Press <ENTER> to continue.  <-自動アップデート方法が表示されるので確認
・・・(省略)
[root@]#

 
  以上の設定でインストールは完了です。

 ▲AntiVirの設定手順へ


 AntiVirの動作確認
  ・AntiVirの使用方法を確認(ヘルプファイルの表示)
   ヘルプを見るとたくさんのオプションがあることに気づきます。
   ※よく使う部分を赤文字としています。
[root@]# antivir --help <-AntiVirのヘルプを参照
Usage is: antivir [options] [path[\*.ext]] [*.ext]
where options are:
--help .......... display this help text (abbreviation: -h or -?)
--allfiles ...... scan all files (not just program files) <-全ファイルをスキャン
--version ....... show version information  <-バージョン情報を表示
--info .......... show list of recognized forms
--update ........ update AntiVir  <-AntiVirのアップデート
--check ......... used with --update to check for updates
--temp=<dir> .... specify the directory for temporary files
--pid-dir=<dir> . specify the directory for PID files
--home-dir=<dir> location of executable, VDF and key files
-C <filename> ... name of configuration file (default /etc/antivir.conf)
-s .............. scan subdirectories <-サブディレクトリもスキャン
--scan-in-archive files in archives will be extracted and scanned
-z .............. synonymous for --scan-in-archive (scan in archives, too)
↑圧縮ファイルもスキャン

--archive-max-size=N, --archive-max-recursion=N, --archive-max-ratio=N
anti DoS feature: do not scan archive content which would
exceed the given file size, nesting level or compression
factor limits on extraction (0 means unlimited)
--scan-in-mbox .. scan mailbox folders, too (might be time consuming!)
--heur-macro .... enable macro heuristics
--heur-nomacro .. disable macro heuristics
--heur-level=N .. setup heuristics level: 0=off, 1-3=low-high
-nolnk .......... do not follow symbolic links
-onefs .......... do not cross file systems while following links
-noboot ......... do not check any boot records
-nombr .......... do not check any master boot records
-nobreak ........ disable Ctl-C and Ctrl-Break
-nodef ......... do only check the given file types (eg. *.DOC)
-cf<filename> ... activate CRC check and name the database
-cv ............. calculate CRC over the whole file length (default 16k)
-cn ............. insert new files into the database
-cu ............. recalculate CRC values and update the database
-v .............. scan files completely (slower with possible false alerts)
-nopack ......... do not scan inside packed files
-e [-del | -ren] repair concerning files if possible <-感染ファイルの修復
[-del] non-repairable files will be deleted
[-ren] non-repairable files will be renamed
-ren ............ rename concerning files (*.COM->*.XXX,...)
-del ............ delete concerning files <-修復できなければ削除
-dmdel .......... delete documents containing suspicious macros
-dmdas .......... delete all macros if one appears to be suspicious
-dmse ........... set exit code to 101 if any macro was found
-r1 ............. just log infections and warnings
-r2 ............. log all scanned paths in addition
-r3 ............. log all scanned files
-r4 ............. select verbose log mode
-rs ............. select single-line alert messages
-rf<filename> ... name of log file
%d = day, %m = month, %y = year (two digits each)
-ra ............. append new log data to existing file
-ro ............. overwrite existing log file
-q .............. quiet mode <-バックグラウンド動作
-lang[:|=]DE .... use German texts
-lang[:|=]EN .... use English texts
-once ........... run only once a day
-if<dateiname> .. AntiVir uses the given ini file
--with-<type> ... detect other (non-virus but unwanted) software, too;
type may be e.g. "dial", "joke", "game", etc
--without-<type> like --with-<type>, but disables this type
--alltypes ...... combination of all known --with-<type> options
--warnings-as-alerts exit with a return code as if a concerning file
had been found when warnings have been issued
--exclude=<file> exclude files or directories from scan
--log-email=<addr> send out scan report by email, too
@<rspfile> ...... read parameters from the file <rspfile>
with each option in a separate line

 
  ・全ファイル対象でウィルススキャンを実施
[root@]# /usr/lib/AntiVir/antivir / -e -s -z -del --allfiles     [return]
  ※オプション指定は上のヘルプファイル(赤文字部分)を参照ください。

   とりあえず、ウィルスが見つからないことを祈ってしばし休憩....

  ・ウィルスの検出および削除を確認
   ここでは、害のないウィルスをダウンロードして実際に検出できるかを確認してみます。
   
   →wgetコマンドにより無害なウィルスをダウンロードします。
[root@]# wget https://www.eicar.org/download/eicar.com
--19:42:36-- https://www.eicar.org/download/eicar.com
=> `eicar.com'
www.eicar.org をDNSに問いあわせています... 完了しました。
www.eicar.org[83.246.65.3]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 68 [application/x-msdos-program]

100%[========================================================>] 68 66.41K/s ETA 00:00

19:42:38 (66.41 KB/s) - `eicar.com' を保存しました [68/68]
[root@]#

  →AntiVirでウィルススキャンを実施
[root@]# antivir ./ -e -s -z -del --allfiles
AntiVir / Linux Version 2.1.5-36 +gui
Copyright (c) 1994-2005 by H+BEDV Datentechnik GmbH.
All rights reserved.

Warning: The file "antivir.vdf" is more than 14 days old.

VDF version: 6.33.0.7 created 25 Nov 2005

For private, non-commercial use only.
AntiVir license: 149996 for PersonalEdition Classic

auto excluding /proc from scans (is a special fs)
checking drive/path (list): ./
./eicar.com
Date: 4.08.2004 Time: 00:23:41 Size: 68
ALERT: [Eicar-Test-Signature virus] ./eicar.com <<< Contains code of the Eicar-Test-Signature virus
not removable
file deleted.

↑ダウンロードした無害なウィルスを発見

------ scan results ------
directories: 21
scanned files: 2561
alerts: 1<-ウィルスの検出
suspicious: 0
repaired: 0
deleted: 1<-ウィルスの削除
renamed: 0
scan time: 00:00:48
--------------------------

  見事ウィルスを検出して削除しています。
  とりあえず正常に動作してそうです^^

  ※Cronに登録すれば、アップデートとスキャンを自動で実行することができます。
  
 ▲AntiVirの設定手順へ



 Copyright(c) 2005, All Rights Reserved.