Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday all *.exe files on my machine were infected by Win32.Neshta virus after I ran one program via wine. I cured the machine with rm -rf ~/.wine, but it's no good anyway.

So, I decided to set owner root:root and mode 644 on all *.exe, *.com... files. But the owner of the directories is still me. So, I (and, therefore, viruses) can freely rename/remove *.exe files. It's bad.

How can I protect *.exe files from being modified/ renamed/ removed by viruses?

Now I have two ideas:

  • chattr +i

  • make a hardlink for all *.exe to a separate root directory

share|improve this question
You answered your own question: chattr +i – psusi Feb 26 '12 at 19:29
@user14284: How did you discover that you had the virus? I ask because I use wine apps and this type of info can be useful. – Peter.O Feb 26 '12 at 19:58
Run wine in a chroot jail or remove the emulated access to the rest of your computer (see wiki.winehq.org/SecuringWine - winetricks sandbox). – Ingmar Hupp Feb 27 '12 at 2:35
@Peter.O: I just noticed that one my little DOS MZ-file become bigger PE-file (but it still work). I looked for contents and found string "Delphi-the best. Fuck off..." -- it's Neshta's joke. – Corvus Feb 27 '12 at 14:14
I don't see how hardlinks will help, but chattr +i sounds fine. – penguin359 Mar 2 '12 at 22:52

Instead of Wine, just use a Windows virtual machine using VirtualBox. I have used that method in school and it worked quite well. If the virtual machine gets a virus, simply delete it and make a new one.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.