Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im putting one of them in /etc/fstab, and I know both these strings are supposed to lock down /tmp to protect the kernel from vulnerabilities that can occur due to shared memory and tmpfs file systems.. But which one is more hardened for security? Also I like to note that I use live installs and I read that the command mount -a, would have these configuration changes take affect without me having to do a system restart (which I cant do cause I'm in a live environment).
Last edited by justmy2cents; 07-27-2017 at 02:54 PM.
According to man fstab, this is what the "defaults" option means:
Quote:
defaults
use default options: rw, suid, dev, exec, auto, nouser, and async.
I'm in no way qualified to answer your question, but it seems to me that the phrase "defaults,noexec,nosuid" contains internal contradictions, unless the "noexec,nosuid" cancel out what "defaults" specifies by being positioned after it.
Perhaps someone who does know will help both of us out.
In /etc/fstab, the "defaults" option is just a no-op keyword needed when the options field would otherwise be empty, since the file format does not allow for empty fields. If there is any other option in that field, there is no need for "defaults". It has no effect, and that is regardless of where it is in the sequence of options.
I got those strings from "Ubuntu server hardening" websites, and more than a few included the defaults option. Though I understand now why you guys say it's pointless, but maybe it's used for interoperability with /etc/apt/apt.conf? E.g. some packages upon installation need to run scripts out of /tmp, and if /tmp is mounted with noexec the package wont install. So the solution is to remount /tmp without the noexec setting, or to automate it upon installation by adding this code to /etc/apt/apt.conf
Is anyone familer with the code (the DPkg one) and if so would this new string be compatable with it? none /run/shm tmpfs ro,noexec,nosuid,nodev /tmp";};. Mind you I came up with that myself with what I think I know about this.
Last edited by justmy2cents; 07-31-2017 at 11:33 AM.
I actually recently just found out that /run was created by Lenart Poettering to act as a unified tmpfs to replace multiple tmpfs, such as /var/lock, /dev/shm, /tmp, /var/run.. I'm not sure how Im supposed to feel about this. But anyways thanks for the info! If anyone has a response pertaining to post #4 , that would be cool..
Last edited by justmy2cents; 07-31-2017 at 12:15 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.