Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If you’ve migrated to Linux or Mac seeking refuge from the never-ending stream of threats that seems to target Windows, you can breath a lungful of fresh air—just don’t let your guard down.
Though UNIX-like systems such as Mac OS X and Linux can claim fewer threats due to their smaller user bases, threats do still exist. Viruses can be the least of your problem too. Ransomware, like the recent version of KillDisk, attacks your data and asks you to pay, well, a king’s ransom to save your files. (In the case of KillDisk, even paying the ransom can’t save you if you’re running Linux.)
Keep your system updated
As I’ve written before, keeping your system updated will ensure that any security holes stay patched. Depending on the software you have installed, updates may be available daily. I recommend running an update at least once every two weeks.
If for some reason you’d prefer to keep the current versions of your software, you should still update your kernel at minimum.
Don’t trust strange networks
Next time you go to a college campus or coffee shop, take a look around. You’ll probably see a collection of shiny, relatively new laptops, with people busily clicking, typing, and swiping away. It’s a jackpot for thieves, but not the kind you might imagine.
Open Wi-Fi networks are a big liability. Anyone with the right software and wireless setup can sniff the unencrypted Wi-Fi traffic buzzing though the air. A virtual private network (VPN) should be a first line of defense whenever you’re on a network away from home or the office. If you’re unfamiliar with what a VPN does, take a minute to read up on them. When in doubt, VPN up.
If you want to use a VPN on Linux, you’ll have to make sure you have the right packages installed. Most consumer VPNs will likely use the OpenVPN or IPSec protocols, but corporate VPNs may use Cisco’s AnyConnect. You can even set up a VPN at home on the cheap. Be sure to consult your distribution’s package database to install the right plugin for the protocol you’re using. Fedora’s manual has a step-by-step description of how to connect to a VPN with the Gnome 3 desktop.
Keep your guard up
You can also install and run firewalls in Linux. Firewalls can help keep outsiders from making unwanted connections through the network. Unless your desktop or laptop is running a specific service (like Samba to share files with Windows machines), it’s best to make sure the firewall denies access to incoming connections.
Linux users have a number of tools to choose from. I like Fedora’s Firewalld because it is both versatile and easy to use, and allows a degree of granular control that’s not overwhelming. The program allows the user to set zones based on connection or interface, and to define and control what services are allowed to accept traffic. Firewalld is available for several distributions through GNOME Software or other package managers. Gufw is another firewall that allows far less granularity, but surpasses Firewalld in simplicity.
Run antivirus scans once in a while
That’s right, there are indeed viruses that target Linux. However, few of those viruses target desktop Linux, since the platform represents such a small percentage of market share. (Servers are another issue.) While Windows viruses may not affect a Linux machine, a Linux PC can still be a “carrier” for a virus that’s hiding in an executable file, script, or compromised document.
Since Linux and UNIX-like servers are so popular, the platform is targeted by viruses. However, given the application of said servers, antivirus solutions for Linux are often meant for the enterprise and business world. Consumers that run Linux are largely left out of the anti-malware market on Linux.
Back up your data
Last but not least, be sure to back up your data. A good backup can be a life saver, sparing you the significant expense and headache of having to recover lost data from a dead or irreparable drive.
If you’ve got a backup of your data, you can pull a Sigourney Weaver and write off the PC’s filesystem as lost and start from scratch.
Since most of the software you’ll use with Linux can be downloaded from the internet for free, your data and configuration files are really the only things that matter. There are are several ways to back up data to an external source, including rsync and automatic backup services. However, the software you use often matters a lot less than the safety of the backup media and frequency of backup.
Linux is a rock-solid computing platform, but it’s not indestructible or impervious to attack. By keeping an eye on your system and using appropriate defensive measures when warranted, you can ensure that your Linux PC (and the Windows PCs you share files with) stays squeaky clean of digital creepy crawlies.
This story, "Why Linux users should worry about malware and what they can do about it" was originally published by PCWorld.