Linux Server Admin Tools and GNU Benchmark Tools Directory, OpenSource Tools

Secure Tmp Directadmin / Plesk

Here are few simple steps to create/secure /tmp partition on the server installed with Directadmin or plesk panel.

 

1 -> SSH the server as root.

 

2 -> Create the /tmp/tmpMnt using dd (the below example with create a 2.4 GB partition)

 

 

3 -> Make an extended filesystem (ext3) over /dev/tmpMnt

 

 

4 -> Backup the existing /tmp partiton

 

 

5 -> Mount the new /tmp filesystem with noexec

 

 

6 -> Copy everything back to new /tmp and remove backup

 

 

7 -> Edit the /etc/fstab and add the following line at the bottom (Save & exit)

 

 

8 -> Test it using the mount and umount commands

 

 

9 -> List the partition and make sure it is added correctly

 

 

The output may look similar below.

 

Tmp Partition