HostSEO Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog

How to Secure /tmp using files

Securing /tmp  is easy in a web hosting linux server ,  if you don’t have a partition for /tmp

1) create a raw file of size 5 GB as follows
dd if=/dev/zero of=/usr/tmpfile bs=1M count=5000
2) Format it using ext3 file system
mkfs.ext3 /usr/tmpfile
3) Add the mount entry in /etc/fstab as follows
/usr/tmpfile              /tmp                    ext3 loop,nosuid,noexec,rw 0 0
4) Stop apache and mysql
/etc/init.d/httpd stop
/etc/init.d/mysqld stop
5) Move the current /tmp and mount as follows,
mv /tmp /tmp.old
mkdir /tmp
rm -rf /var/tmp 
ln -s /tmp /var/tmp
mount -a
chmod  1777 /tmp
6) Start mysql and apache
/etc/init.d/mysqld start
/etc/init.d/httpd start

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar


Born in 2004 ... Trusted By Clients n' Experts

SEO Stars

They never made me feel silly for asking questions. Help me understand how to attract more people and improve my search engine ranking.

Read More

Emily Schneller Manager at Sabre Inc
SEO Stars

Took advantage of Hostseo's superb tech support and I must say, it is a very perfect one. It is very fast, servers reliability is incredible.

Read More

Leena Mäkinen Creative producer
SEO Stars

We're operating a worldwide network of servers with high quality standards requirements, we’ve choose hostseo to be our perfect partner.

Read More

Ziff Davis CEO at Mashable
SEO Stars

It’s very comfortable to know I can rely about all technical issues on Hostseo and mostly that my website and emails are safe and secured here.

Read More

Isaac H. Entrepreneur
SEO Stars

With hostseo as a hosting partner we are more flexible and save money due to the better packages with great pricing, free SEO n' free SSL too!

Read More

Madeline E. Internet Professional