Secure /tmp
—————–
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.
[root@abc ~]# cp –pv /etc/fstab /etc/fstab.bak
Make a 3G file for /tmp and check the current filesystem type of /tmp
[root@abc ~]# dd if=/dev/zero of=/var/tempFS bs=1024 count=3072000
[root@abc ~]# /sbin/mkfs.ext3 /var/tempFS
Now, create a backup of current /tmp
[root@abc ~]# cp -Rpf /tmp /tmpbackup
Mount the new /tmp and set required permissions
[root@abc ~]# mount -o loop,noexec,nosuid,rw /var/tempFS /tmp
[root@abc ~]# chmod 1777 /tmp
Copy the old /tmp data and edit fstab
[root@abc ~]# cp -Rpf /tmpbackup/* /tmp/
[root@abc ~]# vi /...
Recent Comments