19

I think I may have a virus. How would I go about checking for a virus and how can I protect my computer from any other virus? Please give detailed answer as I'm still learning about Ubuntu.

Olli
  • 9,129

2 Answers2

36

To scan for viruses on Linux, you'd us clamav. You can install it from the repositories using the software center.

If you're new to Linux, this is the perfect time to try out the command line interface, because it works well, and it's hard to screw anything up.

If you're feeling up to it, open a terminal window by typing Ctrl+Alt+t.

In that window, type sudo apt-get install clamav. This will tell the computer that a "super user" is telling it to install the clamav virus scanning software. It will ask for your password.

Now that you've installed the software, you need to update the files that it uses to identify viruses. You should type sudo freshclam. Your computer will know you're a super user because you just typed in your password a few seconds ago.

When all is done, you're ready to scan. If you'd like to scan your home directory (all your user files), you'd type something like

 clamscan --remove=yes -i -r ~/

This calls on clamscan to remove any virus it finds, show you only infected files, to act recursively by running through every subdirectory of you home directory. ~/ is shorthand for your home directory. You might want to run it without the --remove flag just to see what it finds first.

If you were to type man clamscan you'd see a list of options. As I said, this is a great place to start using the command line.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
Marc
  • 10,152
0

Avast! has free antivirus for Linux, which you can use to check Ubuntu for viruses and remove if any were found. Here is how you can install it.

  1. Download it form here
  2. Open the file and install it
  3. register your free account here
  4. You must change Ubuntu's shmmax to accept updates(as they are too big). This is how you can do this. Open terminal (Ctrl + Alt + T) and enter:

    gksudo gedit /etc/init.d/rcS

    Add this line of code in a new line directly before the line, which should already be there, exec /etc/init.d/rc S

    sysctl -w kernel.shmmax=128000000
    
  5. Save it and restart computer

BuZZ-dEE
  • 14,533