I have just started studying FreeBSD to use it as a web server. I'm almost done setting up everything.
My question is which is the right way of securing /tmp and /var/tmp in FreeBSD?
Are these commands correct?
The first one I tried were these commands (from CentOS)
But what that did was a
error when executing /etc/periodic/weekly/310.locate.
I've searched using Google but this is just the information that I got:
Thanks in advance.
My question is which is the right way of securing /tmp and /var/tmp in FreeBSD?
Are these commands correct?
Code:
rm -rf /tmp
mkdir /tmp
rm -rf /var/tmp
mkdir /var/tmp
mount -t tmpfs -o noexec,nosuid,nosymfollow /tmp
mount -t tmpfs -o noexec,nosuid,nosymfollow /var/tmp
chmod 1777 /tmp
chmod 1777 /var/tmp
echo "tmpfs /tmp tmpfs noexec,nosuid,nosymfollow 0 0" >> /etc/fstab
echo "tmpfs /var/tmp tmpfs noexec,nosuid,nosymfollow 0 0" >> /etc/fstab
The first one I tried were these commands (from CentOS)
Code:
rm -rf /tmp
mkdir /tmp
mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
chmod 1777 /tmp
echo "tmpfs /tmp tmpfs rw,noexec,nosuid 0 0" >> /etc/fstab
rm -rf /var/tmp
ln -s /tmp /var/tmp
But what that did was a
Code:
mktemp: mkdtemp failed on /tmp/locatex4zybqBRGf: Permission denied
I've searched using Google but this is just the information that I got:
Secure /tmp and /var/tmp directories and mount it with noexec, nosuid, nosymfollow.
Thanks in advance.