I've heard of ClamAV and rkhunter, but I'm not sure how useful they are. How easy is it to get malware on Linux, and what's a sensible way to check for it?
How likely is Linux to get malware, and how should I scan for it?
Answers
Linux can get malware, though desktop infections are generally less common than on Windows. The risk depends a lot on what you install, what services you expose to the internet, and whether your software is kept up to date.
Using your distribution's official repositories is a good starting point. Be more cautious with third-party packages, random install scripts, attachments, and commands that ask for sudo. A password prompt doesn't stop a malicious program from accessing files your own account can read or change.
Reply to this answer
ClamAV is reasonable for an on-demand scan, especially for Downloads or files you're passing to other people. Update its virus definitions first, then scan the files or directories you're concerned about.
It can catch known threats, including Windows malware, but a clean result isn't proof that a system is clean. It won't necessarily catch a new or unknown threat.
m.642~corkladder:
So scanning Downloads makes sense even if a suspicious file wouldn't run directly on Linux?
Mivela.3p:
Yes. You could still pass an infected file to someone using Windows. Also, Windows programs run through Wine can pose a risk to files your account can access.
Reply to this answer
rkhunter is a different sort of tool. It checks for signs associated with rootkits and other suspicious system changes rather than acting like a general file scanner. Its warnings need investigation because legitimate updates or configuration changes can trigger them too.
If you get a warning, check what changed and whether it matches an expected package update before deleting anything. Neither rkhunter nor ClamAV is a guarantee that a compromised machine will be detected.
Reply to this answer
For a personal desktop, prevention is usually more useful than relying on periodic scans. Keep the system and browser updated, be careful with downloads, and don't paste sudo commands into a terminal unless you understand and trust them. A browser ad blocker can also reduce exposure to sketchy ads.
Reply to this answer
Add your answer
Answers are reviewed before publication.
6t+hingequartz_254:
Community-maintained repositories can be handy, but they aren't the same thing as your distribution's official repositories. Check the package and its source before installing.