I noticed that some files downloaded from the internet have executing permission (e.g. Tor, Bit-torrent, Sync etc.) by default.
Therefore the permission information is stored within the files itself, but not on the computer.

Does that mean, that there's a possibility for hackers to create viruses and set execute permission?
If that's so, hackers could trick the user to execute the virus.
From this point of view, security on Linux is not better than Windows.

Can someone explain this clearly to me?


No. Whenever you create a new file the umask is applied. This umask is a number that dictates what permissions will the file have.

For having execution permission masks should be either 7, 5 or 3. No file is created with those masks. But, beware of compressed files, since those keeps their file permission when you extract them. If you keep downloading things from trusted sources and verify the content before doing anything, you should be alright.

Let's see how umask works:

For files the default mask is 0666 and the umask is 0022. The system each time you create a file do this operation:

mask - umask = file permissions
0666 - 0022  = 0644

The permissions numbers broken down is like follows:

|||\_ others permissions, in this case only read
|| \__ groups permissions, in this case only read
| \___ user permissions, in this case read and write
 \__ special byte

Hence, each file created by your user is created so you can read and write the file, your group can read them, and others can read them too. Nothing to do with the executables.

  • I understand now. Tor and BittorentSync are compressed so their permission is kept. Thanks. Sep 16 '13 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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