Tag: secure tmp

Secure tmp

On a cpanel server you could secure tmp using the script /scripts/securetmp

However, most of the servers would find the tmp space inadequate. So you can increase the tmp size using either the manual method or again using the securetmp script. Below are the steps to accomplish the same.

We have 3 scenarios here

1 ) Running securetmp for the first time.

2 ) Need to increase tmp size but have already run securetmp

  • Increase space again using securetmp script
  • Manually Increase the space.

Let us see how this can be done.

1 ) Running securetmp for the first time.

As of now the cpanel script /scripts/securetmp create a file of size 512 MB and /tmp is mounted on this file. But 512 MB would be inadequate for a busy server, so first we shall modify the script to create the tmp file whose size is more than 512 MB. Let us assume that our server needs 1 GB of tmp space.

The script uses kilobytes in it, so let us convert 1 GB to KB

1 gigabyte = 1 048 576 kilobytes

Now let us make the change in the securetmp script

# replace “512000” “1048576”  −− /scripts/securetmp

Now we can run the script

# /scripts/securetmp

And answer few questions it asks before it setups the new tmp partition.