Wednesday, August 11, 2010

NMAP With Examples


NMAP is one of the most important tool. Which checks which ports are open on a machine.
Some important to note about NMAP
  1. NMAP abbreviation is network mapper
  2. NMAP is used to scan ports on a machine, either local or remote machine (just you require ip/hostname to scan).
  3. NMAP is can be installed on windows, Sun Solaris machines too.
  4. NMAP can be used to scan large networks, remember I am saying large networks.
  5. NMAP can be used to get operating system details, uptime, software used for a service and its version no, vender of network card and uptime of that system too(Don’t worry we will see all these things in this post.
  6. Please do not try to use NMAP on machines which you don’t have permission.
  7. Can be used by hackers to scan for systems for venerability.
  8. Just a funny note : You can see this NMAP used by trinity in Matrix-II, when she tries to hack in to electric grid super computer.
Note : NMAP man pages one of the best man pages I have come across. It is explained in such a way that even new user can understand it easily and one more thing it is even having examples in to how to use NMAP in different situations, when you have time read it. You will get lots of information.

Example1 : Using NMAP in normal way, i.e. to scan a particular system for open ports
#nmap hostname
Example2 : Scanning for a single port on a machine
#nmap –p 22 hostname
This will scan for 22 port is open on a host or not. And here –p indicates port.
Example3 : For scanning only ports
#nmap –F hostname-F is for fast scan and this will not do any other scanning like IP address, hostname, operating system, and uptime etc. It’s very much fast as it said in man pages.
Example4 : For scanning only TCP ports
#nmap –sT hostname
Here s is for scanning and is for only scanning of TCP ports

Example5 : For scanning only UDP ports#nmap –sU hostnameHere indicates UDP port scanning
Exmaple6 : Scanning for ports and to get what is the version of different services running on that machine
#nmap –sV hostname
V indicates version of each network service running on that host

Example7 : To check which protocol is supported by the remote machine#nmap –sO hostname
Example8 : To scan a system for operating system and uptime details# nmap -O hostname
-O
 is for operating system scan along with default port scan

Example9 : Scanning a network#nmap networkID/subnetmaskFor the above command you can try in this way#nmap 192.168.0.0/24
Some sites to refer (not for practical examples, but for to get good concept):nmap.org : official site for our NMAP en.wikipedia.org/wiki/Nmap 
Please Comment your thoughts regarding this post:-)

Swap Management


Step1:First check what is the swap space the system is having and utilization of swap size

#free -m   
#swapon -s 
-s for st
#cat /proc/swaps

this will give output of swap statistics in Megabytes(m), if we want the output in Kilobytes then free -k

Step2:Before starting the Swap management we have to take precautions such as switch off all the swap and no user should be logged in  

#swapoff -a

Step3:Check in the system if there is any raw space in the system

#fdisk -l

Step4:If the system is having free space then create a partition which support swap(partition type 82) with required amount of free space

#fdisk /dev/hda

p                #press p to print the partition table
n                #press n for creating new partition
256M          #specify the amount of swap required
t                 #press t to change the partition type to 82 (because partition type 82 is well supported for swap)
8                 #enter the partition no on which u want to create swap(here i am creating on /dev/hda8 partition)
82               #specifying the partition type
p                 #press p to print the partition table and to just conform the /dev/hda8 partition type
w                #press w for writing the changes to partition table (if suppose if u have any problem or trouble just                                           press q to quit from fdisk utility without any problem)

Step5:update the partition table changes to kernel so that there is no need to restart the system/server

#partprob

Step6:Permanently mounting the partition details,in order to do this one we have to update the /etc/fstab file

#vi /etc/fstab

/dev/hda8    swap    swap    defaults    0 0

enter the above entires in to fstab file,save it and exit from editing /etc/fstab file

:wq

Step7:formatting/creating swap signature on the newly created partition

#mkswap /dev/hda8

Note:stpe6 and step7 are interchangeable.

Step8:update the mount table to kernel

#mount -a

Step9:now on the swap so that it can be available for use.

#swapon -a

Step10:check weather the swap is updated or not

#free -m   
#swapon -s 
#cat /proc/swaps


Removing swap:
Step1:Before doing any thing with swap first we have to switch of the swap

#swapoff -a

Step2:Remove/comment the entry of swap from /etc/fstab file

#vi /etc/fstab

then save and exit
Step3:update the kernel about mount table changes

#mount -a

Step4:Remove the partition used by swap

#fdisk /dev/hda8

d                #press d to delete the partition
8                #specify the partition no to be deleted 
w                #press w to write the changes to partition table and quit the fdisk utility

Step5:update the partition table changes to kernel with out rebooting the system/server

#partprobe

Step6:now on the swap 

#swapon -a

Step7:now check weather swap is updated properly or not

#free -m   
#swapon -s 
#cat /proc/swaps

Actually its advantageous if we create swap partition separately if the server is not having any raw space left what we can do ? At any cost we have to increase the swap to improve the system productivity 
To come out of this situation there is one solution provided by Linux e.i we can create a swap file with in all ready existing and using partition if that partition is having sufficient free space

Step1:Switch off all the swap before any swap management

#swapoff -a

Step2:Determine what is the swap size we required(here i am taking 128MB) and execut the following command with count equal to 131072 (because 131072 is equal to 128M)

#dd if=/dev/zero of=/swapfile bs=1024 count=131072

Step3:Now set this swap file in order to use this file as swap

#mkswap /swapfile

Step4:Edit the /etc/fstab file to specify the swap file for perminient swap space

#vi /etc/fstab

/swapfile    swap    defaults    0 0

:wq

Step5:Update the kernel about the mount table changes

#mount -a

Step6:After managing the swap on the swap

#swapon -a

Step6:Check weather the swap space is updated or not by using following commands

#free -m   
#swapon -s 
#cat /proc/swaps
 

Removing swap:

Step1:Before doing any thing with swap first we have to switch of the swap

#swapoff -v /swapfile

Step2:Remove/comment the entry of swap from /etc/fstab file

#vi /etc/fstab

then save and exit

Step3:update the kernel about mount table changes

#mount -a

Step4:Remove the swapfile permanently 

#rm /swapfile

Crontab configuration in Linux

Crontab is the default scheduling Application/program in most of the Linux/Nix boxes.
Crontab is define as scheduling of programs/scripts/applicaions with out administrator interventions
Crontab = (Cron)oligical+(tab)le nothing but time table for executing some scripts at that point of time

So where we requre crontab?
where there is no need for admin intervetions such as taking dialy backups sending mails to perticular users monitoring network.

So coming to scheduling task crontab uses clock daemon (/usr/sbin/cron or perhaps /usr/sbin/crond) that executes commands at specific times. and corn tables for each user is located in /var/spool/cron/ with their names
suppose you want to see cron table for root(cat /var/spool/cron/root)

Crontab file content

The content of the file can be devide in to 6 feilds(first 5 for specifing time and last one for executing scripts/app etc)
The first five fields are separated by either a space or a tab and represent the following units, respectively:

* minutes (0-59)
* hour (0-23)
* day of the month (1-31)
* month of the year (1-12)
* day of the week (0-6, 0=Sunday)


Configuration of crontab for user

Step1:Creating crontab for a user

#crontab -e -u username
-e is for specifing editing and -u for specifing username when you are scheduling crontabs for other users
if users want to schedule their own he can just give (crontab -e)
Example:

I will take one example here to explain crontab,suppose I want to execute one script located in /var/test/script.sh and save the output to /temp/script.out should be executed every 10th of each month at 9:43pm

#crontab -e -u surya

so here it will open a temporary in /tmp folder

43 21 10 * * /var/test/script.sh > /temp/script.out

here * in month field and week field indicates any month and any week execute this script

after entering the values save and exit the file, A file will be created in as /var/spool/cron/surya with the above content

Step2:seeing crontab for a perticular user

#crontab -l -u username

Example

#crontab -l -u surya

If you are a user and want to see your crontab you can just give (crontab -l)

Step3:Removing crontab for perticular user

This can be acheived in two ways
1)removing all the crontab entries for a perticual user

#crontab -r -l username

Example

#crontab -r -l surya

2)removing one task for perticual user,for doing this we have to edit the crontab

#crontab -e -l username

Please see here some of the crontab issues

SUDO

Sudo (su "do") the name it self indicates that switching user and to do some command as admin.
What actually the difference between su and sudo is that,su is switch user so that we should know administrator password to get admin rights.
But this is security threat for the superuser password it self.
So if an admin wants to give a normal user some/all admin rights depending on his/her requirement's so that he can execute some system level commands and in turn it will not effect root's integrity/properties etc.

So how to give sudo permissions to user?
To use sudo the sudo package should be installed on the server.

step1:quarry for the sudo package

#rpm -q sudo


step2:If the sudo package is not installed install it by below command

#rpm -ivh sudo.versionno.arch.rpm


step3:configuring sudousers

#visudo


there is no space between vi and sudo right? remember this.
when you execute the above command you will be able to open one temporary file which contains all sudo related configuration in it
so you will find some thing like below
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# User privilege specification
root    ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

you will find some thing like this in that file
this file is self explanatory
We will see some example
user alias specification you can find it
this is the place where we can put user names to whom I want to give sudo permissions
so this is  my sample file
User_Alias USER=surendra
here I declared surendra to use sudo
Cmnd_Aias CMD=/usr/sbin/useradd
I set CMD to /usr/sbin/useradd so if I combined USER variable and CMD variable
the user surendra can execute useradd command with out having admin rights
so this the way I can combine the USER and CMD
USER ALL=CMD
so USER(surendra) can execute all the commands(ie CMD)
so after doing that save and exit that file
so log-in as surendra
and to access sudo you have to use like below
$sudo /usr/sbin/useradd

Like this we can add as many commands as possible which are not available to normal users

Lost Root password


When you lost root password how you can recover and login back in to the system?
To login in to system there are so many ways to get root access depending on security level of the system.
Method1: When there is no password set to access runlevel 1.
Here are the steps to change your root password the most esiest way is as follows..

1. Start your computer when you see Redhat Linux boot loader(GRUB menu where you can see all the Operating system's in the system) select the redhat linux and press "e", and select second line where you can set the temporary runlevel for the system to boot

2. You will notice that now you can edit boot loader command arguments now again press "e" and edit the line to add single or 1 without quots at the end of line.

3. Press enter to return to previous screen

4. Press b to boot with this new argument which will run Linux into single user mode. Please make sure that you see single at the end of line.

5. Now you will get root login with out asking for a password in single user mode.

6. Use "passwd" command to change your password.
#passwd
here it will not ask previous password so you can just enter new password.

7. When updateing the password in runlevel1 if the server is not allowing you to change password giving you error, this is due to/etc/shadow file issue.
In order to resolve this issue execute the following command and then try to change the password

#pwunconv

7.After changing the password just type exit command which will take you to default runlevel of the system or just Reboot and use the new password.

Method2: When GRUB boot loader is protected with a password.
When the GRUB boot loader is protected by a password the above mentioned method will not work, so how to login to the system?
In order to retrive root password we have to have first RHEL cd or a live CD(may be konpics/Ubuntu) .
It is easy to boot using the first Cd.
then enter into the rescue mode
just type linux rescue and boot prompt with out quoat

Now we will be logged in to a normal shell, do the folowing steps
Step1 : change the root partation to /mnt/sysimage

chroot /mnt/sysimage

Step2 : Now just change the password
passwd
Step3 : Exit from rescue mode
#exit
#exit

then login with the new passwd
And if you don't have the correct version CD, you can boot from a live CD,
Mkdir /a
mount ... /a
vi /a/etc/password

delete the password in /etc/shadow for root
Now it will come up with no root password (change immediately).

File Types In Linux

"How many types of files are there and what are they?" This is a common question to every person who started learing Linux.

Why is this so much important to know file types? 
Ans : This is because Linux will consider every thing as files. The Answer to this question is little bit confusing with different answers.

Let me put it in this way to clarify. By default Unix have only 3 types of files..
They are.


1. Regular files
2. Directory files
3. Special files(This is the file type who is the culprit for different answers. This catagory is having 5 sub types.)


So Total file types in Linux are 7. Remeber I am saying in linux there are only 7 types of files but if it comes to unix it is 8 types.

Here are those files. And you can see the file type indication at leftmost part of “ls -l” command
1. Regular file(-)
2. Directory files(d)
Special files
3. Block file(b)
4. Character device file(c)
5. Named pipe file or just a pipe file(p)
6. Symbolic link file(l)
7. Socket file(s)


For your information there is one more file called door files(D) which is present in Sun Solaris. A door is a special file for inter-process communication between a client and server(so total 8 types in Unix machines.).

Regular files : These are the files are indicated with "-" in ls -l output. And these files are.1. Readable files or
2. A binary files or

3. Image files or
4. Compressed files etc.

How to create them?
Ans : Use touch command. 

Example listing of regular files :-rw-r--r-- 1 krishna krishna 20986522 2010-01-31 13:48 test.wmv

-rw-r--r-- 1 krishna krishna 173448 2010-01-30 21:20 Transformers-Teaser-Wallpaper-310.jpg


-r-xr-xr-x 1 root root 135168 2009-12-12 19:14 VIDEO_TS.VOB

-rw-r--r-- 1 krishna krishna 2113536 2009-12-01 13:32 Aditya 365 – Janavule.mp3

-rwxrwxrwx 1 root root 168 2010-02-14 14:12 xyz.sh


Directory files : These contains the name and location of files/folders/special files stored on a physical device. And this type of files will be in blue in color.

How to create them?
Ans : Use mkdir command


Example listing of directories.drwxr-xr-x 2 surendra surendra 4096 2010-01-19 18:37 bin
drwxr-xr-x 5 surendra surendra 4096 2010-02-15 18:46 Desktop
drwxr-xr-x 2 surendra surendra 4096 2010-01-18 14:36 Documents
drwxr-xr-x 2 surendra surendra 4096 2010-02-13 17:45 Downloads


Block files : These files are hardware files most are present in /dev

How to create them?
Ans : Use fdisk command or create virtual partition.

Example listing of Block files(for you to see these file, they are located in /dev).
brw-rw---- 1 root disk 8, 1 2010-02-15 09:35 sda1
brw-rw---- 1 root disk 8, 2 2010-02-15 09:35 sda2
brw-rw---- 1 root disk 8, 5 2010-02-15 09:35 sda5


Character devices files : Provide only a serial stream of input or output.

Example listing of character files(located in /dev)
crw-rw-rw- 1 root tty 5, 0 2010-02-15 16:52 tty
crw--w---- 1 root root 4, 0 2010-02-15 09:35 tty0
crw------- 1 root root 4, 1 2010-02-15 09:35 tty1


Pipe files : The other sort of pipe is a “named” pipe, which is sometimes called a FIFO. FIFO stands for “First In, First Out” and refers to the property that the order of bytes going in is the same coming out. The “name” of a named pipe is actually a file name within the file system. --www.linux.com

How to create them?Ans : Use mkfifo command.Example listing of pipe files
prw-r----- 1 root root 0 2010-02-15 09:35 /dev/.initramfs/usplash_outfifo
prw-r----- 1 root root 0 2010-02-15 09:35 /dev/.initramfs/usplash_fifo
prw------- 1 syslog syslog 0 2010-02-15 15:38 /var/run/rsyslog/kmsg


Sybolic link files : These are linked files to other files.

How to create them?
Ans : use ln command

Example listing of linked files
lrwxrwxrwx 1 root root 24 2010-02-15 09:35 sndstat -> /proc/asound/oss/sndstat
lrwxrwxrwx 1 root root 15 2010-02-15 09:35 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 2010-02-15 09:35 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 2010-02-15 09:35 stdout -> /proc/self/fd/1


Socket files : socket file is used to pass information between applications for communication purpose

How to create them?
Ans : You can create a socket file using socket() system call avialable under 

Example
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
You can refer to this socket file using the sockfd. This is same as the file descriptor, and you can use read(), write() system calls to read and write from the socket.
Example listing of socket files.
srw-rw-rw- 1 root root 0 2010-02-15 09:35 /dev/log
srwxrwxrwx 1 root root 0 2010-02-15 10:07 /var/run/cups/cups.sock
srwxrwxrwx 1 root root 0 2010-02-15 09:35 /var/run/samba/winbindd_privileged/pipe
srwxrwxrwx 1 mysql mysql 0 2010-02-15 09:35 /var/run/mysqld/mysqld.sock


A tip for you guys.
How to find your desired type of a file ?Ans : Use find command with -type option.

For example if you want to find socket file, just use below command.
find / -type sIf you want to find linked file then how?Find / -type l

Thats it.. You got it.. :) Enjoy reading..

Notes For Vi Editor

VI editor is the default file editor in most of the Linux/Nix machines. It is having great capabilities to edit a file with in few key strokes. 

Lets start with some general information and then move on to some good things what vi editor can do for you while editing a file.
1. Vi stands for visual.
2. Vi have its variants like vim which stands for VIMproved, VimX11 for gui and winvi for MS windows.
3. Vi is the most popular editor and next most popular editor is gedit.
4. Do you know there is a book on VI editor from orally which is of 600+ pages.
5. Some other editors which will do the work of editing files are neno, pico, gedit, emacs, joe, nedit, ed etc

Learning vi editor and remembering them is a very a easy task if you learn it in a systematic way. 
a. Modes of VI
b. Navigational commands
c. Editing commands.
d. Search and Replace
e. Save and quiting a file.

a. Modes of VI : Vi have two mode of operation.
1. Command mode
2. Inserting mode

Command mode : 
Vi editor begins in command mode, where cursor movement(navigation in the file) and editing occur. To enter in to command mode from Inserting mode press esc button. 

Inserting mode : 
Used for entering text, this is similar to notepad in Windows. To enter in to inserting mode you can use any of the following.
i or I => present line
=> one line down the present line
=> one line above

Note : All comments will work in command mode only.

b. Navigational commands :1. Character navigation k, h, l and j
h => To move one character left.
=> To move one line down.
=> To move one line up.
=> To move one character right.

How to use above commands in clever way?
Examples : 
6j => to move 6 lines down from the present courser.
7k => to move 7 lines above from the present courser.

2. Word Navigation
=> word forward.
=>word forward, but end of the word.
=> one word backward.

Examples :
32w => To move 32 words forward
6b => To move 6 words back.

3. Setting (nu) mbering to lines 
:set nu
Removing of (nonu)mbering to lines 
:set nonu

4. Moving paragraphs 
move one paragraph up => {{
move one paragraph down => }}

5. Moving page up/down
For up => ctrl+b
For down => ctrl+f

6. Moving start/end of the file
Starting of the file(first line => [[
End of the file(last line) => ]]

7. Going to any line : 
:lineno 

Example : 
If we want to go to 56 line then type
:56

c. Editing commands
8. Replace one letter 
Replace one letter => r
Delete one letter => x

9. Editing one word
Edit one word => cw
Delete one word => dw

10. Editing one line
Editing a line from courser to the end of that line => d$

11. Cutting
deleting(cutting) one line => dd

Examples : 
2dd(deleting/cutting two lines)

12. Pasting
Pasting a line below the courser => p
Pasting a line above the courser => P

13. Coping
Copying one line => yy
Copying n lines => nyy

14. Special commands
joining lines => J
undoing things => u
repeating previous command => .

d. Search and replace

15. Search for a term /term

Example : If you want to search for suresh then press /suresh enter
/suresh
Moving to next occurrence, press "n" with out quotes moving to previous occurrence, press "N" with out quotes.

16. Searching and replacing a term(here separator is / )
:%s/searchterm/replaceterm/g
change default separator
:%s_/home/surya/grade_/home/testing/dest_g

To search and replace particular term from given line to other given line.
:%s294,304/sahana/xyz/g

e)Save and quiting a file:w => save the file
:q => quit the file
:wq => save and quit
:w! => force save the file
:q! => force quit with out save
:wq => save and quit forcefully

History Of Linux


1950 : The history of computer operating systems starts in this year, with simple schemes for running batch programs(running programs in groups these prog will not interact with user) efficiently, minimizing idle time between programs.

1960's : Interactive use of systems started to gain ground. Not only interactive use, but having several people use the same computer at the same time(noting but multi user), from different terminals. Such systems were called time-sharing systems and were quite a challenge to implement compared to the batch systems.

1965's : There were many attempts at building good time-sharing systems. Some of these were university research projects, others were commercial ones. One such project was Multics, which was quite innovative at the time. It had, for example, a hierarchical file system, something taken for granted in modern operating systems. This multics was the project of combined effort of Bell Lab's, MIT,GE. The Multics project did not, however, progress very well. It took years longer to complete the anticipated and never got a significant share of the operating system market. One of the participants, Bell Labs, withdrew from the project. The Bell Labs people who were involved then made their own operating system and called it as Unix.

1969 : First UNIX 1 was released.

1970-1989 : So many flavers of unix came at this time depending on the lack of feature's in previous systems up tounix 7 was released in this time.

1990 : By this time, Unix had a strong position in the server market and was especially strong in universities. Most universities had Unix systems and computer science students were exposed to them. Many of them wanted to run Unix on their own computers as well. Unfortunately, by that time, Unix had become commercial and rather expensive. About the only cheap option was Minix, a limited Unix-like system written by Andrew Tanenbaum for teaching purpose. There was also 386BSD, a precursor NetBSD, FreeBSD, and OpenBSD, but that wasn't mature yet, and required higher end hardware than many had at home.
Into this scene came Linux, in October, 1991. Linus Torvalds, the author, had used Unix at the University of Helsinki, and wanted something similar on his PC at home. Since the commercial alternatives were way too expensive, he started out with Minix, but wanted something better and soon started to write his own operating system. After its first release, it soon attracted the attention of several other hackers. While Linux initially was not really useful except as a toy, it soon gathered enough features to be interesting even for people uninterested in operating system development.

first mail from linus to hacker community
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Message-ID: <1991aug25.205708.9541@klaava.helsinki.fi>
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki 
Hello everybody out there using minix -
I'm doing a (free) operating system (just a hobby, won't be big and
professional like gnu) for 386(486) AT clones. This has been brewing
since april, and is starting to get ready.I'd like any feedback on
things people like/dislike in minix, as my OS resembles it somewhat
(same physical layout of the file-system(due to practical reasons)
among other things). I've currently ported bash(1.08) and gcc(1.40),and
things seem to work.This implies that I'll get something practical within a
few months, and I'd like to know what features most people would want. Any
suggestions are welcome, but I won't promise I'll implement them :-)
Linus (torvalds@kruuna.helsinki.fi)
PS. Yes - it's free of any minix code, and it has a multi-threaded fs.
It is NOT protable (uses 386 task switching etc), and it probably never
will support anything other than AT-harddisks, as that's
all I have :-(.

Second mail to community:

From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: Free minix-like kernel sources for 386-AT
Message-ID: <1991oct5.054106.4647@klaava.helsinki.fi>
Date: 5 Oct 91 05:41:06 GMT
Organization: University of Helsinki
Do you pine for the nice days of minix-1.1, when men were men and wrote their own device drivers?
Are you without a nice project and just dying to cut your teeth on a OS you can try to modify for your
needs? Are you finding it frustrating when everything works on minix? No more all-nighters to get a nifty program working? Then this post might be just for you :-)
As I mentioned a month(?)ago, I'm working on a free version of a minix-lookalike for AT-386 computers. It has
finally reached the stage where it's even usable (though may not be depending on
what you want), and I am willing to put out the sources for wider distribution. It is just version 0.02 (+1 (very
small) patch already), but I've successfully run bash/gcc/gnu-make/gnu-sed/compress etc under it.
Sources for this pet project of mine can be found at nic.funet.fi (128.214.6.100) in the directory /pub/OS/Linux.
The directory also contains some README-file and a couple of binaries to work under linux
(bash, update and gcc, what more can you ask for :-). Full kernel source is provided, as no minix code has been
used. Library sources are only partially free, so that cannot be distributed currently. The system is able to compile
"as-is" and has been known to work. Heh. Sources to the binaries (bash and gcc) can be found at the
same place in /pub/gnu.

Linux itself is only the kernel of an operating system. The kernel is the part that makes all other programs run. It implements multitasking, and manages hardware devices, and generally enables applications to do their thing. All the programs that the user (or system administrator) actually interacts with are run on top of the kernel. Some of these are essential : for example, a command line interpreter (or shell), which is used both interactively and to write shell scripts (corresponding to .BAT files). Linus did not write these programs himself, and used existing free versions instead. This reduced greatly the amount of work he had to do to get a working environment. In fact, he often changed the kernel to make it easier to get the existing programs to run on Linux, instead of the other way around.
Most of the critically important system software, including the C compiler, came from the Free Software Foundation's GNU project. Started in 1984, the GNU project aims to develop an entire Unix-like operating system that is completely free. To credit them, many people like to refer to a Linux system as a GNU/Linux system. (GNU has their own kernel as well).
During 1992 and 1993, the Linux kernel gathered all the necessary features it required to work as a replacement for Unix workstations, including TCP/IP networking and a graphical windowing system (the X Window System). Linux also received plenty of industry attention, and several small companies were started to develop and distribute Linux. Dozens of user groups were founded, and the Linux Journal magazine started to appear in early 1994.
Version 1.0 of the Linux kernel was released in March 1994. Since then, the kernel has gone through many development cycles, each culminating in a stable version. Each development cycle has taken a year or three, and has involved redesigning and rewriting large parts of the kernel to deal with changes in hardware (for example, new ways to connect peripherals, such as USB) and to meet increased speed requirements as people apply Linux to larger and larger systems (or smaller and smaller ones : embedded Linux is becoming a hot topic). Now the latest version of linux is 2.6.33.3

Soon Linus faced some confrontation from none other than Andrew Tanenbaum, the great teacher who wrote MINIX. In a post to Linus, Tanenbaum commented:

"I still maintain the point that designing a monolithic kernel in 1991 is a fundamental error. Be thankful you are not my student. You would not get a high grade for such a design :-)"
(Andrew Tanenbaum to Linus Torvalds)

Linus later admitted that it was the worst point of his development of Linux. Tanenbaum was certainly the famous professor, and anything he said certainly mattered. But he was wrong with Linux, for Linus was one stubborn guy who won't admit defeat. Tanenbaum also remarked that : "Linux is obsolete". Now was the turn for the new Linux generation. Backed by the strong Linux community, Linus gave a reply to Tanenbaum which seems to be most fitting:

Your job is being a professor and researcher: That's one hell of a good excuse for some of the brain-damages of minix.
(Linus Torvalds to Andrew Tanenbaum)

And work went on. Soon more than a hundred people joined the Linux camp. Then thousands. Then hundreds of thousands. This was no longer a hackers toy. Powered by a plethora of programs from the GNU project, Linux was ready for the actual showdown. It was licensed under GNU General Public License, thus ensuring that the source codes will be free for all to copy, study and to change. Students and computer programmers grabbed it.
Soon, commercial vendors moved in. Linux itself was, and is free. What the vendors did was to compile up various software and gather them in a distributable format, more like the other operating systems with which people were more familiar. Red Hat , Caldera, and some other companies gained substantial amount of response from the users worldwide. While these were commercial ventures, dedicated computer programmers created their very own volunteer-based distribution, the famed Debian. With the new Graphical User Interfaces (like X-window System, )the Linux distributions became very popular.

Meanwhile, there were amazing things happening with Linux. Besides the PC, Linux was ported to many different platforms. Linux was tweaked to run 3Com's handheld PalmPilot computer. Clustering technology enabled large number of Linux machines to be combined into a single computing entity, a parallel computer. In April 1996, researchers at Los Alamos National Laboratory used Linux to run 68 PCs as a single parallel processing machine to simulate atomic shock waves. But unlike other Supercomputers costing a fortune, it was rather cheap. The do-it-yourself supercomputer cost only $152,000, including labor (connecting the 68 PCs with cables)-about one tenth the price of a comparable commercial machine. It reached a peak speed of 19 billion calculations per second, making it the 315th most powerful supercomputer in the world. And it was a robust one too. Three months later it still didn't have to be rebooted.


A Beaming Linus Today

The best thing about Linux today is the fanatic following it commands. Whenever a new piece of hardware is out, Linux kernel is tweaked to take advantage of it. For example, within weeks after the introduction of Intel Xeon® Microprocessor, Linux kernel was tweaked and was ready for it. It has also been adapted for use in Alpha, Mac, PowerPC, and even for palmtops, a feat which is hardly matched by any other operating system. And it continues its journey into the new millennium, with the same enthusiasm that started one fine day back in 1991.

Patricia Miranda Torvalds
Linus in 2002

As for Linus, he remains a simple man. Unlike Bill Gates, he is not a billionaire. Having completed studies, he moved to USA and landed a job at Transmeta Corporation. After conducting a top-secret research and development project, Transmeta launched the Crusoeâ„¢ processor. Linus was an active member of the research team. Recently married to Tove, he is the proud father of a girl, Patricia Miranda Torvalds. But he remains as the world's most favorite and most famous programmer to this date. Revered by Computer communities worldwide, Linus is by far the most popular programmer on this planet.

Addtional info related to OS's:
Different types of unix's
1BSD
2BSD
3BSD
4BSD
4.4BSD Lite 1
4.4BSD Lite 2
386 BSD
Acorn RISC iX
Acorn RISC Unix
AIX
AIX PS/2
AIX/370
AIX/6000
AIX/ESA
AIX/RT
AMiX
AOS Lite
AOS Reno
ArchBSD
ASV
Atari Unix
A/UX
BOS
BRL Unix
BSD Net/1
BSD Net/2
BSD/386
BSD/OS
CB Unix
Chorus
Chorus/MiX
Coherent
CTIX
CXOs
Darwin
Debian GNU/Hurd
DEC OSF/1 ACPDesktopBSD
Digital UnixDragonFly BSD
Dynix
Dynix/ptx
ekkoBSD
Eunice
FireFly BSD
FreeBSD
FreeDarwin
GNU
GNU-Darwin
Gnuppix GNU/Hurd-L4
HPBSDHP-UX
HP-UX BLS
IBM AOS
IBM IX/370
Interactive 386/ix
Interactive IS
IRIS GL2
IRIX
Linux Lites
LSX
Mac OS X
Mac OS X Server
Mach
MERT
MicroBSD
Mini UnixMinix
Minix-VMD
MIPS OS RISC/osMirBSD Mk Linux
Monterey
more/BSD
mt Xinu
MVS/ESA OpenEdition
NetBSD
NeXTSTEP
NonStop-UX
Open DesktopOpen UNIX
OpenBSD
OpenDarwin
OpenServer
OpenSolaris
OPENSTEP
OS/390 OpenEdition
OS/390 Unix
OSF/1PC-BSD
PC/IXPlan 9
Plurix
PWB
PWB/UNIX
QNX
QNX RTOSQNX/Neutrino
QUNIX
ReliantUnix
Rhapsody
RISC iX
RT
SCO UNIX
SCO UnixWare
SCO Xenix
SCO Xenix System V/386
Security-Enhanced Linux
Silver OS
Sinix
Sinix ReliantUnix
Solaris
SPIX
SunOS
Triance OS
Tru64 Unix
Trusted IRIX/B
Trusted Solaris
Trusted Xenix
TS
Tunis UCLA Locus
UCLA Secure Unix
Ultrix
Ultrix 32M
Ultrix-11
Unicos
Unicos/mk
Unicos/mp
Unicox-maxUNICS
UniSoft UniPlus new
UNIX 32V
UNIX Interactive
UNIX System III
UNIX System IV
UNIX System V
UNIX System V Release 2
UNIX System V Release 3
UNIX System V Release 4
UNIX System V/286
UNIX System V/386
UNIX Time-Sharing System
UnixWare
UNSW
USG
Venix
Xenix OS
Xinu
xMach
z/OS Unix System Services
Here is now some unixes that are not [yet] in my chart. Some web sites have listed them, like this site or this site. If you want to find more unixes, try Google :-)
ABCenix
ACIX
AD
Altos System V
ARIX
AurOS
BOS/X
C Executive
CLIX Consensys Unix
Concentrix
ConvexOS
CPIX
Cromix
CX/UX
DC/OSx
Dell Unix
DG/UX
DISTRIX
DNIX
DomainOS
DRM System
DTIX
DVIX
ENIX
EP/IX
Esix SVR4
Eurix
FOR:PRO
FreeMiNT
FTX
Genix
HCR
Helios
HEP-UPX
HI-UX
IDRIS
INOS
LSX
LynxOS
MachTen
MacMach
MAXION/OS
MCS
Micronix
Microport SVR4
MicroPort Unix
Mimosnew
MMOS
MP-RAS UNIX
MST UNIX
Mulplix
Munix
NachOS
NCR Unix
NDIX
News-OS
NUXI
Oasis
ONIX
OPUS
OS 9
OS/MP
OSx
PCUNIX
PNX
QNIX
Regulus
RT/EMT
RTUX
SORIX
SOX
Sphinx
SPP-UX
Stellix
SUNIX
Super-UX
System B
Thix
TI System V
TNIX
Topix
TOS
Tropix
UHC Unix
Umax
Uniq
Unisis
Unity
UNOS
UTEK
UTS
UTX/32S
UX
UXP/DS
UZIX
VM/IX
VOLVIX
Xoftnix
Zeus

home page's of different people who are resposiable for development of OS(unix and linux):

Brian Kernighan
http://cm.bell-labs.com/cm/cs/who/bwk/index.html

Dennis Ritchie

http://cm.bell-labs.com/cm/cs/who/dmr/index.html
Ken Thompson

http://plan9.bell-labs.com/who/ken/

The above three are responsable for unix first version.
Different types of Linux's
The below site will give u different types of linux's

The below guy responsable for linux develepment

Linus Torvalds

http://www.cs.helsinki.fi/u/torvalds/

And last but not least see the link below
http://www.catb.org/~esr/faqs/linus/
Q & A1. When is first UNIX introduced?Ans : 1969.
2. What is the present version of RedHat Enterprice Linux (by april 2007)?Ans : RHEL5.
3. What is the present version of linux kernel (by april 2007)?Ans : Precent version of linux kernel is 2.6.20.7.
4. What is the kernel type used bye linux?Ans : Modular kernel (i will explain this in comming class ie in 133 classes).
5. State some Unix flavers you know?Ans : Free BSD, NetBSD, OpenBSD, HP Unix(from HP), Solaries (from Sun micro systems).
6. State some Linux flavers you know?Ans : RHEL, Fedora, CentOS, Ubuntu, Lindows(which have features of linux and MS window's), Suse, Debain etc.
7. What is the main difference between fedora and RHEl?Ans : a.RedHat will give support to only for RHEL but not for Fedora with some charge.
b. Fedora is a open source no help is provided by RedHat user group's will provide help for this Fedora.
c. For every 2 years RHEL will be released where as Fedora is for very 6 months.
8. What is the different OS released from RedHat in the devision of RHEL side?Ans : a. RedHat Desktop
b. RedHat Enterprice server
c. RedHat Advanced Server
d.RedHat work station.
9. What is the difference between Uinx and Linux?a. unix is monolithic kernel where as linux uses modular kernel.
b. some commands will differ
c. unix is commersial where as linux is free
d. linux support different hardware you can install linux on notebook too.
10.What is the difference between linux and window's?Ans : The given below link is enoughhttp://www.michaelhorowitz.com/Linux.vs.Windows.html