configure /tmp to be tmpfs,nosuid,nodev RHEL/CentOS

configure /tmp to be tmpfs,nosuid,nodev RHEL/CentOS

configure /tmp to be tmpfs CentOS 6

Usually this configuration is a security standard, it requires /tmp to be cleared on reboot, nodev, and suid are usually associated with this configuration as well.

Add the following to fstab:

so what we told fstab is the following:

tmpfs filesystem is mounted to /tmp, the filesystem type is tmfps, nodev means no devices can be mounted in /tmp, nosuid means that root cannot execute anything in /tmp and size=10G is the amount of space the /tmp space can take from root, you may want to trim this to a more manageable size, depending ont he size of your root disk.

if you already have content in /tmp, you may want to do a rm -rf /tmp/*, from here we do a mount -a, this will load this new configuration, and show if you made any errors.

after any fstab entry, it’s good to do a reboot just in case.

Leave a Reply

Your email address will not be published. Required fields are marked *