Welcome to Linux Family

Linux is a powerful opensource OS. Once you are in it, you feel like a genious! Now what are you waiting for? Install Linux in your machine and make the world out of it!

Apache Webserver Installation guide

Have a Linux server or localmachine? Need to power your own websites in it? Here you go!! Click to unleash apache webserver installation guide and learn to host your own sites

Linux Processes Overview

This document will give you an overview of linux processes. Advanced topics yet to come!!

Stop spamming!Sign outgoing mails

DKIM is an excellent software to digitally sign your outgoing mails and thus ensuring proper inbox delivery of all your mails.

Tuesday, April 26, 2011

Securing /tmp in linux

Securing /tmp is an important part in linux system. I am quoting the general way to secure /tmp in case it is not mounted as a separate partition:

1. Create a file inside /dev with the required size using dd command. Here I am using 500MB.

cd /dev
dd if=/dev/zero of=tmpDSK bs=1024 count=500000

2. Format it with the required filesystem.

mkfs.ext3 /dev/tmpDSK

3. If you need to backup current /tmp dir, do it using cp -rp command. After that mount the newly created file /dev/tmpDSK on /tmp.

mount -o loop,noexec,nosuid,rw /dev/tmpDSK /tmp

4. Give sticky bit and full permission to /tmp.

chmod 1777 /tmp

5. Create entries in /etc/fstab for mounting /tmp during boot process.

vim /etc/fstab

/dev/tmpDSK /tmp ext3 loop,noexec,nosuid,rw 0 0

Save the file.

That is it. You have now got a secured /tmp directory!