Making your Linux installation (more) malware-proof

Windows XP, left unpatched, is vulnerable to malware that can make it shrivel up and die within a few minutes of being connected to the Internet. Even after patching, Windows is still subject to virus and spyware attacks that make third-party security tools a must. Linux, on the other hand, has a reputation for being relatively impervious to attack via the Net. But is it really immune to the threats that stalk Windows?

The answer has long been, and still is, a qualified yes. Sure, occasionally viruses, worms, and rootkits are written specifically to compromise Linux systems. But if you avoid a couple of major blunders, those relatively few threats are unlikely to do you any real harm, for reasons I'll go into below. To sleep utterly soundly, however, you may still need to take some steps to malware-proof your Linux system.

The tables have turned

The first reason your Linux system is probably safe from attack: Recent versions of Linux (kernels 2.4 and 2.6) include a built-in firewall called "iptables" that simply drops all uninvited incoming connections by default. If a worm or a person tries to break into your Linux box from afar, or not so afar, iptables simply turns away and ignores the incoming connection -- the attacker won't know whether a system even exists at the attacked address.

If you don't run mail, Web, FTP, or other servers on your Linux system, you'll probably never need to modify iptables' default settings. However, if you use the Samba server suite to enable file and printer sharing with other local systems, you will have to enable incoming connections to the Samba server in iptables.

In SuSE 10.1 (the distribution I'm most comfortable with), the Yast2 configuration tool lets you make this change in a few clicks: Select Firewall in the 'Security and Users' section, click Allowed Services in the left panel, pick Samba Server from the 'Service to Allow' menu, and then click Add, Next, Accept to make the change. If your distribution lacks a similar interface, try Luigi Genoni's graphical iptables configuration interface, Knetfilter. And, of course, you can configure iptables from the command line; Troy Johnson's Samba and IPTables page shows you how.

Antivirus -- not just for Windows

Here's another reason Linux tends to deflect spyware: By default, most Linux distributions wisely set you up as a lower-privilege user, with a type of account that generally can't allow malicious code to take over the system. Were you to somehow permit a Linux virus or worm to run on your computer, the fact that you are not logged in on the all-powerful root account prevents the malware from attacking the system's (and other users') files. That's why you typically have to log in as root (with the root password) to change Linux system configurations. In contrast, the default Windows XP user account is the full-privilege administrator, which gives viruses and other threats greater leeway to infect and damage the PC.

So simply by not disabling the existing firewall, and by not logging in as root for your day-to-day Web browsing and e-mail, you'll avoid the vast majority of threats. Keep yourself even safer by updating your software regularly to close the inevitable security holes that expose your machine to worms, rootkits, and other exploits.

However, should someone you know lose their head and log in as root, and then run a program that happens to be infected with one of the few Linux viruses known to exist in the wild, that virus could definitely destroy or steal user data. And even if you think you're smart enough to avoid infection, the files moving through your mailbox, Samba file shares (shared files mounted as drives), and other storage mechanisms could still contain viruses destined to infect other systems. These are valid reasons why you might want to use antivirus software on your Linux computer.

Although commercial Linux antivirus products exist, save your money and start with one of several excellent free utilities instead. Even better, pick one that is not only free but open source: the delightfully named Clam AntiVirus. In addition to binary packages (no compiling necessary) for most major Linux distributions, ClamAV is also available for Windows and Mac OS X.

If you'd prefer antivirus software with a commercial track record, try the Linux version of Grisoft's renowned AVG Anti-Virus Free Edition. Because of Linux's inherent safety, the system you save may not be your own, but you'll be doing your part to curb malware altogether.

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Scott Spanbauer

Computerworld
Show Comments

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Matthew Stivala

HP OfficeJet 250 Mobile Printer

The HP OfficeJet 250 Mobile Printer is a great device that fits perfectly into my fast paced and mobile lifestyle. My first impression of the printer itself was how incredibly compact and sleek the device was.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?