Secure Linux/Ubuntu with ClamAV Antivirus
Disclaimer: Accessing the information on this page means you agree to the Sites Privacy Policy & Terms of Use Agreement.
Secure your ubuntu or Linux Operating system with ClamAV Antivirus as we know Linux is the popular for being virus-free operating system, but it could be happen if you download such kind of stuff from unreliable resources and recently ransomware has made a victim to some of such operating systems too and mostly on windows operating system, seems linux still safe but to be careful as virus is like script or some executable file which may affect your computer. As Viruses are not an issue found as majorly on Linux, there aren’t antivirus software available for this OS. But from that fewer, ClamAV is found with great availability to help us on here.
In this article, I will explain how we can install and use ClamAV and scan operating system for viruses.
There are 2 type of program available of clam anti-virus.
- Command Line Utility – ClamAV
- Graphical Utility – ClamTk
ClamAV
ClamAV – is a free, open source and cross-platform anti-virus utility for malicious software and viruses.
ClamTK – is a graphical interface utility. This has been designed to be an easy use, lightweight and on demand scanner on Linux Operating system.
How to install ClamAV?
If you are using Ubuntu then follow this steps to install ClamAV on your Ubuntu Operating System.
First, Open your ubuntu’s terminal or any other command line utility you are using or you can press Ctrl+Alt+T shortcut key to launch terminal on your Ubuntu.
First update your Ubuntu repository index with below command using sudo rights :
$ sudo apt-get update
Once all done with above command, Install ClamAV and ClamAV-Daemon from apt repository :
$ sudo apt-get install clamav clamav-daemon
Here you might have to enter password to proceed installation as well as it will ask for confirmation to continue. Once all done, you can verify installation as well as the number of version you have installed on your Ubuntu using below command:
$ clamscan --version
Output:
$ clamAV 0.100.2
Scan command
The ClamAV provides many option to scan files and folders on your computer system. You can get more help with –help option:
$ clamscan --help
Here we will see example, how to scan Linux computer system using command line :
$ sudo clamscan --infected --recursive=yes --scan-mail=yes --phishing-sigs=yes --phishing-scan-urls=yes --scan-pe=yes --scan-elf=yes --scan-ole2=yes --scan-pdf=yes --scan-html=yes --scan-archive=yes /home/
Above command will just scan then folder /home/ and give result if there are any infected files available or not?
If you want to get output of above command in .txt file or .log file you can use below command:
$ sudo clamscan –infected --log=/root/clamscan_date.txt --recursive=yes --scan-mail=yes --phishing-sigs=yes --phishing-scan-urls=yes --scan-pe=yes --scan-elf=yes --scan-ole2=yes --scan-pdf=yes --scan-html=yes --scan-archive=yes /home/
Now if you want to remove the infected files then run below command:
$ sudo clamscan –infected --log=/root/clamscan_date.txt --recursive=yes --scan-mail=yes --phishing-sigs=yes --phishing-scan-urls=yes --scan-pe=yes --scan-elf=yes --scan-ole2=yes --scan-pdf=yes --scan-html=yes --scan-archive=yes /
If you want to scan your entire Ubuntu System:
$ sudo clamscan –infected --log=/root/clamscan_date.txt --recursive=yes --scan-mail=yes --phishing-sigs=yes --phishing-scan-urls=yes --scan-pe=yes --scan-elf=yes --scan-ole2=yes --scan-pdf=yes --scan-html=yes --scan-archive=yes --remove /
Remove ClamAV:
If you would like to remove ClamAV then run below command:
$ sudo apt-get remove clamav clamav-daemon
Here it will ask your confirmation in form of (Y/N) then please press Y and continue.
ClamTK
If you prefer GUI version of ClamAV then install ClamTK on your Ubuntu operating system, It is available on Ubuntu Software Center.
First launch Ubuntu Software Center from Dock or you can launch from Dashboard to by searching it.
Now, Click on search icon and enter “ClamTK” in search bar. You will have ClamTK in list once you enter:
Now, The ClamTK is listed as above and you need to click on it so it will redirect on the information page inside Software Center.
Here click on Install button and it will pop-up authentication dialog box where enter your sudoer’s password
Kindly note that only an authorised user can add and remove software on Ubuntu so enter the local authorised user’s password here and click on Authenticate.
After above process completed, the process of installation will be finished. And you will get following message on the screen of confirmation that installation succeeded.
From the launch button you will be able to directly launch the application or/else you can search from dashboard too.
If you would like to launch GUI using command then run below command in terminal
$ clamtk
Once you run above command then you will get interface like below:
From this menu, you will able to control application using graphics interface.
Configuration:
- Update preference as per requirement from given option in Settings icon
- You can update or set if you required to whitelist something using Whitelist icon
- You can edit proxy using Network icon
- You can schedule scan or definition updates using Scheduler icon
History:
- You can view previous history of scan using History icon
- You can manage quarantined files using Quarantine icon
Update:
- Update antivirus definition using Update icon
- You can configure update preferences using Update Assistant icon
Analysis:
- Scan files
- Scan folder or directory
- View analysis report using Analysis icon
Remove ClamTK
If you would like to remove ClamTK from your computer system then you can use below method.
Go to Ubuntu Software Center and search ClamTK from the list and you can directly enter ClamTK in search option available on right top side in Software Center.
Now you will have “Remove” button on the screen of clamtk information page inside software center. Just click on it and you will get confirmation pop-up and click on it to start removal procedure.
This article is contributed by RootLinuxBlog. If you like
RootLinuxBlog and would like to contribute, you can submit an article using
contact us from. See your article appearing on the RootLinuxBlog main page and
help other Techies.
Please write comments if you found any error with the above
article would really help us to serve you a better way. Thank you…