RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

How to crash your Linux system with fork bomb

Here is a simple way to crash your Linux system as a non-root user with a bash function called recursively.

$ :(){ :|:& };:

:() is a function which gets called recursively from its body and cannot be killed since it is running on the background with &. : is actually the name of the function.
Here is the same function call in human readable format:

forkbomb(){ forkbomb | forkbomb & }; forkbomb

As you can see the function is calling its self twice in the body. This will start consume all resources of your system and eventually force your Linux system to crash. To get more understanding type simple function on your command line. The following function is harmless:

$ fork_bomb(){ echo "FORK BOMB"; };
$ fork_bomb
FORK BOMB

You can take same measures to ensure that your Linux users would not exploit fork bomb. Fork bomb is not a bug nor weakness of Linux system. The responsibility is in hands of systems administrators to limit number of processes available for a user by editing /etc/security/limits.conf file. To limit username forkbomb to only 50 processes add following line:

forkbomb             hard    nproc           50

If you want to limit entire group called forkbomb to only 100 processes add a line below:

@forkbomb              hard    nproc           100

To make limit of 100 processes as a default value for all users add a followng line:

@forkbomb              hard    nproc           100

Share this linux post:

Submit How to crash your Linux system with fork bomb in Delicious Submit How to crash your Linux system with fork bomb in Digg Submit How to crash your Linux system with fork bomb in FaceBook Submit How to crash your Linux system with fork bomb in Google Bookmarks Submit How to crash your Linux system with fork bomb in Stumbleupon Submit How to crash your Linux system with fork bomb in Technorati Submit How to crash your Linux system with fork bomb in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download