Why does Linux have no viruses?

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,739
Reaction score
1,204
"Why does Linux have no viruses?"

The nature of the setup of a Linux, UNIX, BSD, or even a Mac makes having and running viruses on your system difficult to impossible. *nix operating systems are much more securely designed then Windows. Many functions in Windows can be accessed by services very easily and without a password prompt. Most Linux users can't even change the time of day on the computer without a password prompt. While at times annoying, this level of security is what keeps what few viruses that do exist in Linux under control.

There are some Linux viruses, but not many. Last time I checked there are only about 20 viruses that can infect a Linux box versus the several hundred thousand viruses that can infect a Windows box. All of the Linux viruses exploit various known holes in Linux. All the holes I know of have been patched. So if you run a recent version of Linux, and you keep it patched, you can't be infected by any of them. The structure of Linux makes writing a virus very difficult as it requires root access to do anything of significance. For a virus to run it would have to be granted root access with a password request. If you fail to give it root access then the most a virus could do, if anything, is damage your home directory. It is unlikely it could even run again so it would die there in your home directory. Most smart Linux users grasp the power of root access and would question why an unknown program is suddenly requesting root access. (You don't enter your password for just ANY prompt do you? Only for programs YOU have called up, right?)

Plus each Linux distro is different, so it is difficult to write a virus that would run on say Red Hat and also be able to run on a Debian platform. (or SuSE, or Slackware, or Mandrake?...) This further limits the chances of an outbreak. This variety is one of levels of protection that Linux users have that Windows does not. All Windows boxes are very much alike and that common ground makes for a very ripe breeding ground for viruses.

"Ok so I'm safe from any so called Linux virus, but all those Windows viruses can hurt me because I can read my FAT32 partition, right?"

Not really. A virus isn't magic. It's just a computer program. It is an evil program, but still just a program. Programs can't run on systems they aren't designed for. You can't run a Windows program on a Mac or in Linux or on an IBM Mainframe. If the virus is a Windows virus then in can only infect a Windows system and only when Windows is booted up and running. Why, because Windows is the only thing that can run the code. Can you put an infected file on a Linux system? Sure, but it can't do anything. To Linux it is gibberish. Just like you can't run KDE on Windows or run Microsoft Word on a Linux box.

Linux can't be hurt by Windows viruses, however, it can host them. For example if you use Linux as a mail server then it can pass the virus around just like any other mail server. Note that passing a virus in an email is not the same as infecting the server. A virus is just a program and it can not infect a system unless it is run on it. But if you have an office full of Windows clients and you use your Linux box as an in house mail server or as a file server and one of the Windows clients gets infected then all the other Windows computers are at risk of infection via the Linux box and the email. So if you're running a mail server you might need to consider AV for the server. Otherwise it really isn't an issue. Even with a mail server the Linux server ITSELF can't be infected just all the Windows boxes that connect to it. (Which is bad enough?)

"So what do I need to do? I need to do something, just in case. Don't I?"

The best way to keep your system secure against viruses is by keeping your software updated and patched, by making sure that your system doesn't run unneeded services and a by running a firewall.


My thanks to ...
Nathan Williams, N-Line Computers
 
Joined
Aug 14, 2005
Messages
266
Reaction score
0
Hi Muckshifter.

I havent been on the forum for a while.

I was talking to the IT guys at the campus about Linux security.

Windows can have an unlimited number of administrators I was told and thats a good for hackers bad for ya.

Linux has only one administrator and thats you.

Oh Win ME only can have one.

Oh I like SUSE it blows Red Hat away.
 

floppybootstomp

sugar 'n spikes
Moderator
Joined
Mar 5, 2002
Messages
20,281
Reaction score
1,794
TECHGUNS said:
Oh I like SUSE it blows Red Hat away.

I've been playing with Suse 10, I like it. My first serious attempt to use a Linux Distro, actually.

Love those auto updates, makes things easy. And there's a ton of help online.

All that stuff for free, quite amazing, especially Open Office.

And Mucks, although negligible, there are Linux viruses out there but the author of that article you posted seems to have given the best advice on how to avoid getting them.
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,739
Reaction score
1,204
TECHGUNS said:
Hi Muckshifter.

I havent been on the forum for a while.

I was talking to the IT guys at the campus about Linux security.

Windows can have an unlimited number of administrators I was told and thats a good for hackers bad for ya.

Linux has only one administrator and thats you.

Oh Win ME only can have one.

Oh I like SUSE it blows Red Hat away.
Nice init ... ;)
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,739
Reaction score
1,204
floppybootstomp said:
I've been playing with Suse 10, I like it. My first serious attempt to use a Linux Distro, actually.

Love those auto updates, makes things easy. And there's a ton of help online.

All that stuff for free, quite amazing, especially Open Office.

And Mucks, although negligible, there are Linux viruses out there but the author of that article you posted seems to have given the best advice on how to avoid getting them.
Never have disputed the fact there are Linux viruses ... Nathan is a 'posh' Grogan, they probably know each other. :D

Loads of 'toys' to play with. :thumb:

There are some very anoying "programs" like Boinc ... the Linux part is so shoddy it's a joke ... give me a year (or maybe 3) and I'll re-write it. :D
 
Joined
Aug 14, 2005
Messages
266
Reaction score
0
It took me awhile to download SUSE I used a T1 at the campus to my USB drive one CD at a time.

Its very easy to use and install programs.

Im impressed.

It detected every card on my backup 1.8GHZ media PC. MY TV card, IDE card everything, but my printer.

OH! I use the Gimp for windows and Openoffice for Windows on my other PC. Ya can find some Linux stuff for windows.
 
Last edited:
Joined
Oct 6, 2003
Messages
130
Reaction score
0
Yes the inherent nature of the linux design does help to keep it safe, and there are very few real world viruses. But they do exist, tho not quite like windows.
Per the sage advice, keeping things updated keeps you safe.
The newest bane of windows, the "root kit" actually came from security compromises that were discovered in linux where the attacker installed his dirty
deed as root. There are many security issues for linux servers out there, mostly due to unapplied fixes. A friend of mine who does security issues has noted there are many instances of linux machines compromised by outside users. These are not technically viruses, more akin to a trojan that allows a user to take control.
These are generally expoits to server specific programs, ie http server, ftp, telnet, ssh etc.
One thing not mentioned tho, NEVER wander around the network as root. You can be compromised, and badly. there are rootkits floating around out there that will look for access thru scripts run in browsers. Rare, but they are out there. Doing SU with an open browser does not qualify. I mean logging on as root, and then surfing around.
 
Joined
Apr 10, 2006
Messages
2
Reaction score
1
Its good to share your thoughts with us and also iam presently using the fedora core 4 which is very helpful in desktop, server version. I think there are viruses for the linux also but not somany which are countable

also the correct thing is said by you
 
Joined
Jul 11, 2010
Messages
5,758
Reaction score
552
Just come across this old article (November 2005)and found it very interesting and explained Linux v Microsoft on viruses extremely well. Do you think some of the old technical articles should be re published providing they are still relevant at regular intervals so that newer members can be informed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top