/tmp should be mounted as a separate filesystem with the noexec,nosuid options set

paksociety

Verified User
Joined
Jul 11, 2013
Messages
89
Why when i restart my server csf gives this error??
/tmp should be mounted as a separate filesystem with the noexec,nosuid options set

It means i have to create this after every reboot??????

Regards
Stay blessed
 
Which Linux distro do you use (Centos, Debian, other)?
And are you on a dedicated server or on a VPS system?
 
Oh on vps it's different. You could search the forums for it. Not quite possible on all vps systems as far as I know.
Which vps system is being used?
 
Generally all VPS servers use only one partition. So you'll need to create a virtual partition and load it at boot time. Full details are somewhere in these forums.

Jeff
 
I Am using this method for this
Code:
        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

Please tell me what to do more that when i reboot my VPS and i dont have to do it again.

Thanks
 
Change /etc/fstab to set up themount command (I'm sure it's somewhere in these forums).

I thought about just adding the mount command to the bottom of rc.local but I'm not going to recommend it because it could segment the /tmp command; files which may be created or read during the boot won't be in it once it's mounted.

Jeff
 
give us the output of :
Here it is
Code:
/dev/sda1        /             ext3     defaults,errors=remount-ro 1 1
/dev/sda2        swap          swap     defaults                   0 0
devpts           /dev/pts      devpts   gid=5,mode=620             0 0
proc             /proc         proc     defaults                   0 0

./var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0.
./var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0.
“/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0″
“/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0″
“/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0″
 
Back
Top