Portal Home > Knowledgebase > Articles Database > mount /tmp /var/tmp (Csf warning)


mount /tmp /var/tmp (Csf warning)




Posted by The Calling, 06-02-2011, 11:28 AM
CSF warning: /tmp should be mounted as a separate filesystem with the noexec,nosuid options set /var/tmp is not mounted with the noexec,nosuid options (currently: none). You should modify the mountpoint in /etc/fstab for /var/tmp with those options and remount /dev/shm is not mounted with the noexec,nosuid options (currently: none). You should modify the mountpoint in /etc/fstab for /dev/shm with those options and remount I ran this: mount -t tmpfs -o noexec,nosuid tmpfs /tmp/ mount -t tmpfs -o noexec,nosuid tmpfs /var/tmp/ However, my fstab still shows this

Posted by The Calling, 06-02-2011, 12:04 PM
Strange, I added these 3 lines to fstab I did a umount on /dev/shm twice to remove the commands I ran before, then rebooted. Still getting warnings in CSF.

Posted by chrismfz, 06-02-2011, 12:57 PM
Did you create a tmpDSK file and create a ext3 fs on it ? Or you just paste the lines without creating them first ? Create them, like that: dd if=/dev/zero of=/usr/tmpDSK bs=1024 count=3072000 /sbin/mkfs.ext3 /usr/tmpDSK this will create a 3GB file. Play with "count=3072000" if you need smaller or larger tmp.

Posted by The Calling, 06-02-2011, 01:42 PM
Tried that and re-ran those 2 commands after, but

Posted by The Calling, 06-03-2011, 12:43 AM
Can someone please help?

Posted by DewlanceHosting, 06-03-2011, 01:19 AM
I think you need to enter a mountpoint line in /etc/fstab file, then Last step - Reboot

Posted by blaszlo01, 09-29-2011, 09:35 AM
In RedHat and CentOS I was able to follow steps listed here... ptihosting. com/blog/it-blog /how-to-mount-tmp-noexec-nosuid/ Backup your fstab cp /etc/fstab /etc/fstab.bak Create 1GB tmpmnt partition file cd /var dd if=/dev/zero of=tmpMnt bs=1024 count=1048576 Format new partition mkfs.ext3 -j /var/tmpMnt Press Y when asked Backup old /tmp cp -Rp /tmp /tmp_backup Mount the new /tmp filesystem mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp Set the appropriate permissions chmod 1777 /tmp Copy files back to /tmp cp -Rp /tmp_backup/* /tmp/ Add new /tmp to fstab echo “/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0″ >> /etc/fstab Symlink /var/tmp to /tmp rm -rf /var/tmp/ ln -s /tmp/ /var/tmp

Posted by agriz, 04-12-2012, 03:31 PM
Will this method allow html file uploading?



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read


Language: