Mounting /tmp

ISOS6

Verified User
Joined
May 7, 2009
Messages
322
Location
Erbil, Tarin Hills, Iraq
Hello,

I've discovered that when I change /tmp folder to link, with the noexec, nosuid options set. The link disappears after a few days and changes to normal filesystem folder.

It is not critical problem, but annoys me enough.

Kind regards
 
be careful about that!
dd if=/dev/zero of=/tmpMnt bs=1024 count=1024k
mke2fs /tmpMnt
cp -Rpf /tmp /tmp_backup
add on /etc/fstab
/tmpMnt /tmp ext2 loop,nosuid,noexec,nodev,noatime,rw 0 0
remount your tmp
mount -o loop,nosuid,noexec,nodev,noatime,rw /tmpMnt /tmp
secure the /tmp folder:
chmod 1777 /tmp
move all tmp back to new foder
mv /tmp_backup/* /tmp/
link /var/tmp /home/tmp /usr/tmp to /tmp
rm -rf /var/tmp
rm -rf /home/tmp
rm -rf /usr/tmp
ln -s /tmp /var/tmp
ln -s /tmp /home/tmp
ln -s /tmp /usr/tmp
 
Last edited:
Back
Top