“UbuntuHelp:ClamAV”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/ClamAV}} | {{From|https://help.ubuntu.com/community/ClamAV}} | ||
{{Languages|UbuntuHelp:ClamAV}} | {{Languages|UbuntuHelp:ClamAV}} | ||
− | [http://www.clamav.net/ ClamAV] is a command line virus scanner. It can only detect viruses; it cannot remove them from files. It detects viruses on all platforms, but due to the popularity of the platform, it primarily detects Windows viruses and malware. | + | [[http://www.clamav.net/|ClamAV]] is a command line virus scanner. It can only detect viruses; it cannot remove them from files. It detects viruses on all platforms, but due to the popularity of the platform, it primarily detects Windows viruses and malware. |
Others antivirus running on Ubuntu can be found [[UbuntuHelp:Antivirus|here]]. | Others antivirus running on Ubuntu can be found [[UbuntuHelp:Antivirus|here]]. | ||
=== Installing [[UbuntuHelp:ClamAV|ClamAV]] === | === Installing [[UbuntuHelp:ClamAV|ClamAV]] === | ||
[[UbuntuHelp:ClamAV|ClamAV]] is in the Universe repository. (If you do not have Universe enabled, see [[UbuntuHelp:AddingRepositoriesHowto|AddingRepositoriesHowto]]). | [[UbuntuHelp:ClamAV|ClamAV]] is in the Universe repository. (If you do not have Universe enabled, see [[UbuntuHelp:AddingRepositoriesHowto|AddingRepositoriesHowto]]). | ||
− | [[UbuntuHelp:ClamAV|ClamAV]] has two modes of operation; a program that loads into memory only when you want to scan a file, or for more regular use (such as scanning all incoming e-mail), a program that connects to a [http://www.wlug.org.nz/Daemon daemon] that is always running. | + | [[UbuntuHelp:ClamAV|ClamAV]] has two modes of operation; a program that loads into memory only when you want to scan a file, or for more regular use (such as scanning all incoming e-mail), a program that connects to a [[http://www.wlug.org.nz/Daemon|daemon]] that is always running. |
Database updates can also be downloaded automatically . | Database updates can also be downloaded automatically . | ||
* For manual use: install the package <code><nowiki>clamav</nowiki></code>. | * For manual use: install the package <code><nowiki>clamav</nowiki></code>. | ||
第16行: | 第16行: | ||
Use <code><nowiki>freshclam</nowiki></code>. | Use <code><nowiki>freshclam</nowiki></code>. | ||
You will see an output like this: | You will see an output like this: | ||
− | <pre><nowiki>user@ubuntu:/etc/clamav # freshclam | + | <pre><nowiki> |
+ | user@ubuntu:/etc/clamav # freshclam | ||
ClamAV update process started at Wed Apr 27 00:06:47 2005 | ClamAV update process started at Wed Apr 27 00:06:47 2005 | ||
main.cvd is up to date (version: 31, sigs: 33079, f-level: 4, builder: tkojm) | main.cvd is up to date (version: 31, sigs: 33079, f-level: 4, builder: tkojm) | ||
第23行: | 第24行: | ||
===== Proxy ===== | ===== Proxy ===== | ||
If you are using a http proxy to connect to the internet you will have to edit the file /etc/clamav/freshclam.conf adding: | If you are using a http proxy to connect to the internet you will have to edit the file /etc/clamav/freshclam.conf adding: | ||
− | <pre><nowiki>HTTPProxyServer serveraddress | + | <pre><nowiki> |
+ | HTTPProxyServer serveraddress | ||
HTTPProxyPort portnumber | HTTPProxyPort portnumber | ||
</nowiki></pre> | </nowiki></pre> | ||
第33行: | 第35行: | ||
* To check all files on the computer, but only display infected files and ring a bell when found: <code><nowiki>clamscan -r --bell -i /</nowiki></code> | * To check all files on the computer, but only display infected files and ring a bell when found: <code><nowiki>clamscan -r --bell -i /</nowiki></code> | ||
When [[UbuntuHelp:ClamAV|ClamAV]] has scanned all the files you asked it to, it will report a summary: | When [[UbuntuHelp:ClamAV|ClamAV]] has scanned all the files you asked it to, it will report a summary: | ||
− | <pre><nowiki>----------- SCAN SUMMARY ----------- | + | <pre><nowiki> |
+ | ----------- SCAN SUMMARY ----------- | ||
Known viruses: 33840 | Known viruses: 33840 | ||
Scanned directories: 145 | Scanned directories: 145 | ||
第42行: | 第45行: | ||
Time: 20.831 sec (0 m 20 s) | Time: 20.831 sec (0 m 20 s) | ||
</nowiki></pre> | </nowiki></pre> | ||
− | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png [[UbuntuHelp:ClamAV|ClamAV]] can only read files that the user running it can read. If you want to check all files on the system, use the <code><nowiki>sudo</nowiki></code> command (see UsingSudo for more information). | + | {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png%7D%7D [[UbuntuHelp:ClamAV|ClamAV]] can only read files that the user running it can read. If you want to check all files on the system, use the <code><nowiki>sudo</nowiki></code> command (see UsingSudo for more information). |
==== Run [[UbuntuHelp:ClamAV|ClamAV]] as a daemon? ==== | ==== Run [[UbuntuHelp:ClamAV|ClamAV]] as a daemon? ==== | ||
Install <code><nowiki>clamav-daemon</nowiki></code>. You can then use <code><nowiki>clamdscan</nowiki></code> where you would previously have used <code><nowiki>clamscan</nowiki></code>. | Install <code><nowiki>clamav-daemon</nowiki></code>. You can then use <code><nowiki>clamdscan</nowiki></code> where you would previously have used <code><nowiki>clamscan</nowiki></code>. | ||
第51行: | 第54行: | ||
==== Remove files infected with viruses? ==== | ==== Remove files infected with viruses? ==== | ||
You can add --remove to the clamscan or clamdscan commandline. | You can add --remove to the clamscan or clamdscan commandline. | ||
− | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png ''Note'': No virus scanner is 100% accurate. It is always best to manually check the files you delete, if you are not totally sure that this is what you want to do. | + | {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png%7D%7D ''Note'': No virus scanner is 100% accurate. It is always best to manually check the files you delete, if you are not totally sure that this is what you want to do. |
==== Find out what version of [[UbuntuHelp:ClamAV|ClamAV]] I have? ==== | ==== Find out what version of [[UbuntuHelp:ClamAV|ClamAV]] I have? ==== | ||
Use <code><nowiki>clamdscan -v</nowiki></code>: | Use <code><nowiki>clamdscan -v</nowiki></code>: | ||
− | <pre><nowiki>user@ubuntu:/etc/clamav # clamdscan -V | + | <pre><nowiki> |
+ | user@ubuntu:/etc/clamav # clamdscan -V | ||
ClamAV 0.83/855/Tue Apr 26 06:40:32 2005 | ClamAV 0.83/855/Tue Apr 26 06:40:32 2005 | ||
</nowiki></pre> | </nowiki></pre> | ||
第61行: | 第65行: | ||
==== Schedule [[UbuntuHelp:ClamAV|ClamAV]] to run automatically? ==== | ==== Schedule [[UbuntuHelp:ClamAV|ClamAV]] to run automatically? ==== | ||
You can use the <code><nowiki>at</nowiki></code> command to schedule clamscan or freshclam. For example: | You can use the <code><nowiki>at</nowiki></code> command to schedule clamscan or freshclam. For example: | ||
− | <pre><nowiki>at 3:30 tomorrow | + | <pre><nowiki> |
+ | at 3:30 tomorrow | ||
at>clamscan -i /home/user > mail user@example.com | at>clamscan -i /home/user > mail user@example.com | ||
at> <CTRL-D> | at> <CTRL-D> |
2008年10月19日 (日) 04:35的版本
[[1]] is a command line virus scanner. It can only detect viruses; it cannot remove them from files. It detects viruses on all platforms, but due to the popularity of the platform, it primarily detects Windows viruses and malware.
Others antivirus running on Ubuntu can be found here.
目录
- 1 Installing ClamAV
- 2 Using ClamAV
Installing ClamAV
ClamAV is in the Universe repository. (If you do not have Universe enabled, see AddingRepositoriesHowto). ClamAV has two modes of operation; a program that loads into memory only when you want to scan a file, or for more regular use (such as scanning all incoming e-mail), a program that connects to a [[2]] that is always running. Database updates can also be downloaded automatically .
- For manual use: install the package
clamav
. - For automated use: install the package
clamav-daemon
.
Both methods will also install clamav-freshclam
, the updater.
After installing, you may be asked some questions about how to get virus signature updates. Select the download site closest to you. ClamAV updates are a very small download and it is well worth scheduling them to happen automatically.
Using ClamAV
How can I...
Update my virus definitions?
Use freshclam
.
You will see an output like this:
user@ubuntu:/etc/clamav # freshclam ClamAV update process started at Wed Apr 27 00:06:47 2005 main.cvd is up to date (version: 31, sigs: 33079, f-level: 4, builder: tkojm) daily.cvd is up to date (version: 855, sigs: 714, f-level: 4, builder: ccordes)
Proxy
If you are using a http proxy to connect to the internet you will have to edit the file /etc/clamav/freshclam.conf adding:
HTTPProxyServer serveraddress HTTPProxyPort portnumber
Scan files for viruses using clamav?
Use clamscan
.
Examples:
- To check files in the all users home directories:
clamscan -r /home
- To check all files on the computer, displaying the name of each file:
clamscan -r /
- To check all files on the computer, but only display infected files and ring a bell when found:
clamscan -r --bell -i /
When ClamAV has scanned all the files you asked it to, it will report a summary:
----------- SCAN SUMMARY ----------- Known viruses: 33840 Scanned directories: 145 Scanned files: 226 Infected files: 1 Data scanned: 54.22 MB I/O buffer size: 131072 bytes Time: 20.831 sec (0 m 20 s)
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png%7D%7D ClamAV can only read files that the user running it can read. If you want to check all files on the system, use the sudo
command (see UsingSudo for more information).
Run ClamAV as a daemon?
Install clamav-daemon
. You can then use clamdscan
where you would previously have used clamscan
.
Lots of programs, especially e-mail servers, can connect to a ClamAV daemon. This speeds up virus scanning as the program is always in memory.
The clamav-daemon
package creates a 'clamav' user; in order to allow ClamAV to scan system files, such as your mail spool, you can add clamav to the group that owns the files.
Tell if clamav-daemon is running?
Look for it in the processt list, or use this handy shortcut: ps ax | grep [c]lamd
Remove files infected with viruses?
You can add --remove to the clamscan or clamdscan commandline. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png%7D%7D Note: No virus scanner is 100% accurate. It is always best to manually check the files you delete, if you are not totally sure that this is what you want to do.
Find out what version of ClamAV I have?
Use clamdscan -v
:
user@ubuntu:/etc/clamav # clamdscan -V ClamAV 0.83/855/Tue Apr 26 06:40:32 2005
Learn about other options?
Try man clamscan
.
Schedule ClamAV to run automatically?
You can use the at
command to schedule clamscan or freshclam. For example:
at 3:30 tomorrow at>clamscan -i /home/user > mail user@example.com at> <CTRL-D> job 3 at 2005-04-28 03:30
You have now scheduled a ClamAV scan to happen on your home directory at 3:30 AM tomorrow. The output (showing only infected files) will be sent to you by e-mail.