Securing /tmp on CentOS 5.5 on a VPS

Backup your fstab file
cp /etc/fstab /etc/fstab.bak

Creating tmpmnt partition file (Around 1Gb in size)
cd /vardd if=/dev/zero of=tmpMnt bs=1024 count=1048576

Format the new partition
mkfs.ext3 -j /var/tmpMnt
Press Y when asked

Making backup of old /tmp
cp -Rp /tmp /tmp_backup

Mount the tmp filesystem
mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp

Set the right permissions
chmod 0777 /tmp

Copy the files back to new tmp folder
cp -Rp /tmp_backup/* /tmp/

Adding new /tmp filesystem to fstab
echo "/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0" >> /etc/fstab

No need for 2 tmp filesystems, so we symlink /var/tmp to /tmp
rm -rf /var/tmp/ln -s /tmp/ /var/tmp