You can use the cpanel script /scripts/securetmp to secure tmp partition.
Otherwise follow the steps below. First take a backup of the fstab file, just so that you would be able to revert it to a working copy in case of any issues.
Make a 3G file for /tmp and check the current filesystem type of /tmp
Now, create a backup of current /tmp
Mount the new /tmp and set required permissions
Copy the old /tmp data and edit fstab
Now, time to test the fstab entry
Change the line containing /dev/shm as follows
Modify, the line containing /dev/shm as follows.
Now remount /dev/shm
Backup /var/tmp first.
Sometimes you might get a “device resource busy” error while renaming /var/tmp. It means that some application or process is currently using /var/tmp. In that case, you need to find the processes using /var/tmp and kill them.
If that too doesn’t work, umount /var/tmp and try.
Now, we will use /tmp itself as /var/tmp for security
If your /var/tmp was empty earlier, you might get this error : cp: cannot stat `/var/vartmp/*’: No such file or directory, Once the copying is finished, remove /var/tmpold