secure the tmp directory

Jump to: navigation, search

Changing Partition Attributes (such as securing /tmp) on your Dedicated Server does not need a reboot. You can remount the partition immediately with the new attributes doing something like…

mount -o remount,noexec,nosuid /tmp


make the change in the /etc/fstab

LABEL=/tmp /tmp ext3 noexec,nosuid,nodev,rw 1 2

then remount it

mount -o remount /tmp

Cpanel Server

The following is how to secure your /tmp directory on your Dedicated Server using a cPanel Script. You MUST have cPanel installed for this to work.

  • Login to your server as root via SSH.
  • Type: /scripts/securetmp