LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting a partition with options - easy question (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-a-partition-with-options-easy-question-4175445142/)

zethra 01-11-2013 09:24 AM

Mounting a partition with options - easy question
 
Hi

I am using Fedora core. I am to create a partition /data where users post some data (all have r+w permissions). Hence for security purposes I have to make it non-executable.

I understand from linux security that noexec and nosuid must both be enabled for /data during mounting. I understand noexec and have it enabled. However I dont have nosuid enabled.

Any reason why both noexec and nosuid should be enabled for /data. Doesnt having just noexec suffice - since the users would not be able to run scripts and suid does not matter.

shivaa 01-11-2013 12:21 PM

There are two things to be considered, first is data protection and second is unauthorized use of that data (i.e. execution of any other user's scripts or codes by any unauthorized users).

To avoid any unauthorized execution, you can set SUID on particular files. As far as I know noexec will even not allow the owner to execute it.

Second, for data protection, you can consider sticky bit permission on /data for better protection of this sort of data which is accessible to many different users. Sticky bit will allow only the owner of directory, owner of file or superuser to modify the content. It's quite simple and easy, as:
Code:

chmod -R a+t /data

jpollard 01-11-2013 01:16 PM

Specifically, nosuid, is used to prevent security issues with executables on a disk that may come with, or have unauthorized root priviliges. A set uid (suid) executable causes the current user identification to be replaced with the user identification of the file being executed (view with "ls -l"). A file that is set uid will be shown as "rws" (or "r-s" or even "--s" rather than "rwx" in the owner field.

Having noexec should prevent any executable from being run and protect you just as well. noexec is frequently considered too restrictive though (people will write scripts...), so having nosuid is a good idea.

rknichols 01-11-2013 01:59 PM

Using "noexec" makes "nosuid" superfluous since the files can't be executed at all, but it is still advisable to use "nosuid" just to keep yourself covered on those occasions when you do need to remount the device with "exec" privileges.

Another option you should be using is "nodev", especially on external devices. Otherwise, it is trivial for someone to mount a filesystem containing block-special and/or character-special device nodes and gain direct access to your physical disk drives and even memory.

zethra 01-16-2013 03:42 PM

Thanks everyone. It makes sense now!


All times are GMT -5. The time now is 03:29 PM.