We recently needed to provide proof that we're running anti-virus software on our work machines, only many of us in the office are running Ubuntu. Though we don't really need it, we've installed ClamAV to check for viruses.
This is a guide to help you set up ClamAV on Ubuntu. First, you'll need to make sure you're getting packages from Universe. From the menu bar, go to System → Administration → Software Sources and check the "Community-maintained Open Source software (universe)" checkbox if it isn't already checked.
Now, open up a Terminal window and enter this command:
$ sudo apt-get install clamav
Before running your first scan, you'll want to update your anti-virus definitions:
$ sudo freshclam
Now you can finally run your first scan:
$ sudo clamscan -r -i / > mail name@example.com
This will run the on-demand virus scan (clamscan) on your computer's root directory; it will recurse through the entire filesystem (-r) and it will only output the names of infected files (-i). And when it's done running, it will send you an e-mail with the results of the scan. Alternately, you can redirect the output of the command to a text file. Just change mail name@example.com to clamscan.log. Or, if you'd rather have the output display to the screen, just remove the > and everything after it.
To set up a regular scan, you'll want to edit your /etc/crontab file:
$ sudo gedit /etc/crontab
Add these two lines to the end of the file and save the file:
0 12 * * * root freshclam
5 12 * * * root clamscan -r -i / > mail name@example.comThis runs every day at noon and updates the virus definitions before running the scan. You may want to make adjustments to the frequency or time of the scan, but this should give you a good starting point.







Comments
guest writes:
thank you .