Test Authenticated SMTP using Telnet

We all know how to test SMTP server by telneting to port 25. But, what if you have to test a SMTP server that has to be authenticated before you send a test mail using telnet. The only difference from normal test is, here you have to authenticate with the user/password, not in plain text, but you should send the authentication string with a Base64-encoded (http://base64-encoder-online.waraxe.us) password.

So, here is how you would test authenticated smtp server using telnet.

telnet smtp.mymailserver.net 25

220 mi1 ESMTP service ready
ehlo localhost
250-mi1
250-8BITMIME
250-SIZE 20480000
250-AUTH=PLAIN LOGIN
250-AUTH PLAIN LOGIN
250 STARTTLS
Auth Login
334 VXNlcm5hbWU6
c3VwcG9ydEyMHBsdXNjbHViLmNvbQ==
334 UGFzc3dvcmQ6
RHZsNIwWA==
235 Authentication successful.
MAIL FROM: support@mydomain.com
250 Sender address accepted
RCPT TO: soj@yahoo.com
250 Recipient address accepted
DATA
354 Continue
This is a test message for SMTP auth using telnet. Plz ignore. Don't reply.
.
250 Delivery in progress

So, the difference is what you see in those 3 lines starting from “Auth Login” and the following 2 codes are username and password respectively which does SMTP authentication. Those 2 encoded codes are generated using http://base64-encoder-online.waraxe.us

I hope this helps.

Advertisements

Transparent SQUID Proxy

Here I will show you how to configure SQUID as a transparent proxy server, which means that once the SQUID server is running, you don’t have to configure proxy server IP address on your individual browsers on your client systems. This is something that i forgot to mention in my previous two posts on SQUID – SQUID (Caching Proxy Server) Logs and SQUID ACLs

We all use more than one browser on our system nowadays and with the typical setup, you have to configure SQUID server IP on individual browsers so that all the request pass through the SQUID proxy server. A better way is to configure SQUID server to act as a transparent proxy server and update the client machine’s gateway to use SQUID server’s IP address. That way you don’t have to update proxy server’s IP address on all the browsers that you use on your system.

This is a 3 step process once SQUID is configured:

1. Edit http_port 3128 as below:

http_port 192.168.2.50:3128 transparent

2. Now update firewall rules so all the requests on port 80 gets redirected to port 3128 as follows:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

3. Now, set the gateway on all your client machine to the IP address of your SQUID proxy server.

That’s it. Now, all requests on your client machines will be routed via SQUID server no matter how many different browsers you use.

Pound – A Reverse Proxy Load Balancer

Here is a simple way on how you can set up a muti-node Apache Web server cluster that provides load balancing. In front of the apache cluster I have created a load balancer that splits up the incoming HTTP/HTTPS requests between the multiple Apache nodes. The advantage of using a load balancer is that it takes care of the load on the web server nodes and tries to direct requests to the node with less load and it also takes care of the sessions.

For our setup we configure a program called Pound and behind this pound server, we have two apache webserver nodes.

Pound is a reverse-proxy server. This means that it passes requests from client browsers to one or more back-end servers. Also, Pound acts as a load balancer as it distributes the requests from the client browsers among serveral back-end servers, while keeping session information. Pound is aso an SSL wrapper that can decrypt HTTPS requests from client browsers and pass them as plain HTTP to the back-end servers. Pound can verify requests for correctness and accept only well formed ones. Pound can detect when the backend server fails or is recovered and take actions accordingly. So, it’s also a failover server. We can set priority for preferred back end server in case a particular server has a better hardware to accomodate the heavy load. If priority is not set, it takes the default priority as 5 and the priority ranges from 1 to 9; 9 being the highest priority. Remember that Pound is NOT a Web Server or Web Accelerator. So, no websites are cached.

You can download Pound for REDHAT from the below URL:
http://www.invoca.ch/pub/packages/pound/RPMS/ils-5/SRPMS/

Once installed, you can open the configuration file and update as required:

vi /etc/pound.cfg

User "pound"
Group "pound"
Control "/var/lib/pound/pound.cfg"

ListenHTTP
	Address 192.168.2.50
	Port 80
	Service
	   BackEnd
		Address 192.168.2.10
		Port 80
	   End
	   BackEnd
		Address 192.168.2.20
		Port 80
		Priority 6
	   End
	   Session
  	   	Type IP
		TTL 300
  	   End
	End
End


:wq!

#service pound start
#chkconfig pound on

This tells Pound to listen on the real IP address 192.168.2.50 @ port 80 and proxy all requests to the back-end servers listed. Failover is taken care of automatically and so there’s nothing to configure to accomplish this important feature. The second server has a priority of 6, which means that more requests will be routed to server with IP address 192.168.2.20

Also, Pound is a session-aware server, meaning it keeps track of sessions between a client browser and a back-end server. So, once a session is established, all subsequent requests from the same browser will be directed to the same back-end server. In the above configuration, you can see “Session” configured by client IP address. In this scheme Pound directs all requests from the same client IP address to the same back-end server within a five-minute interval. Though Pound is session-aware, accuracy is NOT guaranteed as HTTP is defined as a stateless protocol. There are five other ways to configure sessions using Pound, but none can guarantee accuracy. The above method of configuring session via IP address is the easiest one, though we have other methods like Basic Authentication, URL parameter, cookie value, HTTP parameter and header value.

Note:

SSL certificates can also be configured if you add the following to your pound.cfg configuration file.

ListenHTTPS
	Address xxx.xxx.x.xx
	Port 443
	Cert "/etc/pki/tls/certs/pound.pem"
End

That’s it.

Managing Storage with LVM

LVM or Logical Volume Manager is a key tool for system administrators managing storage on Linux servers. LVM introduces three layers of abstraction b/n the underlying storage devices on a Linux server and the file system which is accessed by the users.

LVM subsystem

This example has 3 hard drive devices – sdc1, sdd1 and sde. We will use LVM to aggregate these 3 hard drives to provide storage, extend 3 formatted file system and mount it under a directory called ‘/lvmdata’. This additional abstraction between the underlying storage devices and the user accessible file system enables us to manage storage more effectively and with greater flexibility.

Let’s discuss each LVM layer in sequence and take a look at some specific command used to configure each layer.

The 1st layer is know as LVM Physical Volumes (PV’s). A storage device must be formatted as a Physical Volume (PV) before it can participate in the LVM infrastructure that we will be building.

pvcreate /dev/sdc1 /dev/sdd1

You can check the newly created PV using the command ‘pvdisplay’. This command shows the 2 physcal volumes (sdc1 and sdd1) that we used right now.

Next we need to aggregate the PV into a single contiguous pool of storage known as Volume Group (VG).

vgcreate exampeVG /dev/sdc1 /dev/sdd1

You can check the newly created VG using ‘vgdisplay’ command. VGdisplay tells you the volume group name, how much size the volume has and so on.

Finally, we need to carve out a section of VG that we can then place our file system on. This carved out piece of storage is known as Logical Volume (LV).

lvcreate -n exampleLV -L 1G exampleVG

You can check the newly created LV using the command ‘lvdisplay’.

Now, create a file system, create a mount point (/lvmdata/) and then finally mount the new LVM file system back to the mount point.

mkfs.ext3 /dev/exampleVG/exampleLV

mkdir /lvmdata

mount /dev/exampleVG/exampleLV /lvmdata/

We can now expand our /lvmdata filesystem in real time while all the data remains online and fully accessible.

You can look the current storage utilization using df command:

df -h

You can see the new LVM (/lvmdata/) partition which is of 1 gig in size.

Now to extend the /lvmdata partition, you can use the command ‘lvextend’ as follows:

lvextend -L +500M /dev/exampleVG/exampleLV

Here we are adding additional 500 megs of space to the existing exampleLV logical volume. Note the output of df command now. You will see the additional 500 megs is not reflected on the /lvmdata although we have already added 500 megs to it. This is because we have extended the underlying logical volume, but not the file system itself. The command ‘resize2fs’ will do the trick.

resize2fs /dev/exampleVG/exampleLV

Now, check the ‘df -h’ command and see the difference. You will see the additional 500 megs added to the /lvmdata/ partition.

Remember, all this was done without unmounting the filesystem and all the data remained intact and accessible to users.

Migrating data to a SAN storage device:

Imagine you want to migrate all your data from your servers local hard drive to a SAN (Storage Area Network).

In our case the SAN device is /dev/sde

So, our job is to migrate all of our data from local storage (sdc1 and sdd1) to our SAN device (sde)

Using LVM you can easily accomplish this task. First we need to initialize our SAN storage using pvcreate.

pvcreate /dev/sde

Then we can extend our existing Volume Group (VG) on to our new SAN device using ‘vgextend’.

vgextend exampleVG /dev/sde

Now we need to migrate all the data from our local physical volume to our SAN PVs using the command ‘pvmove’

pvmove /dev/sdc1 /dev/sde
pvmove /dev/sdd1 /dev/sde

Finally, we can remove the local storage devices from our VG using the command ‘vgreduce’

vgreduce exampleVG /dev/sdc1 /dev/sdd1

Again, this was done in real time when the file system data remained online and fully accessible to the users.

The below shows the practical example of creation and extending an LVM volume

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):
Using default value 13054

Command (m for help): p

Disk /dev/xvdk: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc77f72d6

Device Boot Start End Blocks Id System
/dev/xvdk1 1 13054 104856223+ 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/xvdk: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc77f72d6

Device Boot Start End Blocks Id System
/dev/xvdk1 1 13054 104856223+ 8e Linux LVM

Command (m for help): w
The partition table has been altered!

[root@nagios ~]# fdisk -l /dev/xvdk

Disk /dev/xvdk: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc77f72d6

Device Boot Start End Blocks Id System
/dev/xvdk1 1 13054 104856223+ 8e Linux LVM

[root@nagios ~]# pvcreate /dev/xvdk1
Writing physical volume data to disk “/dev/xvdk1”
Physical volume “/dev/xvdk1” successfully created

[root@nagios ~]# pvdisplay
“/dev/xvdk1” is a new physical volume of “100.00 GiB”
— NEW Physical volume —
PV Name /dev/xvdk1
VG Name
PV Size 100.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID CgYySs-W40i-zjOn-j1oY-uPk9-982l-fWd0PX

[root@nagios ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/xvdk1 lvm2 a– 100.00g 100.00g

[root@nagios ~]# vgcreate exampleVG /dev/xvdk1
Volume group “exampleVG” successfully created

[root@nagios ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/xvdk1 exampleVG lvm2 a– 100.00g 100.00g

[root@nagios ~]# pvdisplay
— Physical volume —
PV Name /dev/xvdk1
VG Name exampleVG
PV Size 100.00 GiB / not usable 2.66 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25599
Free PE 25599
Allocated PE 0
PV UUID CgYySs-W40i-zjOn-j1oY-uPk9-982l-fWd0PX

[root@nagios ~]# lvcreate -n exampleLV -L 20G exampleVG
Logical volume “exampleLV” created

[root@nagios ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
exampleLV exampleVG -wi-a- 20.00g

[root@nagios ~]# lvdisplay
— Logical volume —
LV Name /dev/exampleVG/exampleLV
VG Name exampleVG
LV UUID xMd0My-l7Ez-dqYb-JM75-cKH3-YOfK-HSV1zx
LV Write Access read/write
LV Status available
# open 0
LV Size 20.00 GiB
Current LE 5120
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0

[root@nagios ~]# vgdisplay
— Volume group —
VG Name exampleVG
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GiB
PE Size 4.00 MiB
Total PE 25599
Alloc PE / Size 5120 / 20.00 GiB
Free PE / Size 20479 / 80.00 GiB
VG UUID 7qvBGR-QYFu-XP27-xx2G-iFUa-GXqX-VCK1zc

[root@nagios ~]# mkfs.ext4 /dev/exampleVG/exampleLV
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242880 blocks
262144 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@nagios ~]# mkdir /lvmdata
[root@nagios ~]# mount /dev/exampleVG/exampleLV /lvmdata/
[root@nagios ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde1 5.8G 3.3G 2.3G 60% /
tmpfs 836M 0 836M 0% /dev/shm
/dev/xvdj1 40G 1.3G 37G 4% /drive
/dev/mapper/exampleVG-exampleLV
20G 172M 19G 1% /lvmdata

[root@nagios soj]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde1 5.8G 3.3G 2.3G 60% /
tmpfs 836M 0 836M 0% /dev/shm
/dev/xvdj1 40G 1.3G 37G 4% /drive
/dev/mapper/exampleVG-exampleLV
20G 2.9G 16G 16% /lvmdata

[root@nagios soj]# lvextend -L +10G /dev/exampleVG/exampleLV
Extending logical volume exampleLV to 30.00 GiB
Logical volume exampleLV successfully resized

[root@nagios soj]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde1 5.8G 3.3G 2.3G 60% /
tmpfs 836M 0 836M 0% /dev/shm
/dev/xvdj1 40G 1.3G 37G 4% /drive
/dev/mapper/exampleVG-exampleLV
20G 2.9G 16G 16% /lvmdata

[root@nagios soj]# resize2fs /dev/exampleVG/exampleLV
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/exampleVG/exampleLV is mounted on /lvmdata; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/exampleVG/exampleLV to 7864320 (4k) blocks.
The filesystem on /dev/exampleVG/exampleLV is now 7864320 blocks long.

[root@nagios soj]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde1 5.8G 3.3G 2.3G 60% /
tmpfs 836M 0 836M 0% /dev/shm
/dev/xvdj1 40G 1.3G 37G 4% /drive
/dev/mapper/exampleVG-exampleLV
30G 2.9G 26G 11% /lvmdata

——————

[root@nagios soj]# pvdisplay
— Physical volume —
PV Name /dev/xvdk1
VG Name exampleVG
PV Size 100.00 GiB / not usable 2.66 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25599
Free PE 17919
Allocated PE 7680
PV UUID CgYySs-W40i-zjOn-j1oY-uPk9-982l-fWd0PX

[root@nagios soj]# vgdisplay
— Volume group —
VG Name exampleVG
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GiB
PE Size 4.00 MiB
Total PE 25599
Alloc PE / Size 7680 / 30.00 GiB
Free PE / Size 17919 / 70.00 GiB
VG UUID 7qvBGR-QYFu-XP27-xx2G-iFUa-GXqX-VCK1zc

[root@nagios soj]# lvdisplay
— Logical volume —
LV Name /dev/exampleVG/exampleLV
VG Name exampleVG
LV UUID xMd0My-l7Ez-dqYb-JM75-cKH3-YOfK-HSV1zx
LV Write Access read/write
LV Status available
# open 1
LV Size 30.00 GiB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0

[root@nagios soj]# pvs
PV VG Fmt Attr PSize PFree
/dev/xvdk1 exampleVG lvm2 a– 100.00g 70.00g

[root@nagios soj]# vgs
VG #PV #LV #SN Attr VSize VFree
exampleVG 1 1 0 wz–n- 100.00g 70.00g

[root@nagios soj]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
exampleLV exampleVG -wi-ao 30.00g
[root@nagios soj]#

========= Creating another partition – lvmvar =============

[root@nagios soj]# lvcreate -n varLV -L 5G exampleVG
Logical volume “varLV” created

[root@nagios soj]# mkfs.ext4 /dev/exampleVG/varLV
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@nagios soj]# mkdir /lvmvar

[root@nagios soj]# mount /dev/exampleVG/varLV /lvmvar/

[root@nagios soj]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde1 5.8G 3.3G 2.3G 60% /
tmpfs 836M 0 836M 0% /dev/shm
/dev/xvdj1 40G 1.3G 37G 4% /drive
/dev/mapper/exampleVG-exampleLV
30G 2.9G 26G 11% /lvmdata
/dev/mapper/exampleVG-varLV
5.0G 138M 4.6G 3% /lvmvar

[root@nagios soj]# lvdisplay
— Logical volume —
LV Name /dev/exampleVG/exampleLV
VG Name exampleVG
LV UUID xMd0My-l7Ez-dqYb-JM75-cKH3-YOfK-HSV1zx
LV Write Access read/write
LV Status available
# open 1
LV Size 30.00 GiB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0

— Logical volume —
LV Name /dev/exampleVG/varLV
VG Name exampleVG
LV UUID y8GibW-vbWh-M68Y-p9vv-AH4f-0FPQ-0cCVwh
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GiB
Current LE 1280
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:1

mknod to your rescue to restore /dev/null

Recently one of my friend unknowingly deleted /dev/null file and it was throwing error when he tried to launch the terminal console. So, what exactly is the file /dev/null ?

/dev/null is a character special file, which means that it is a contentless file that is marked as being able to source and sink byte streams to it. What happens to those streams is determined by their device numbers. Character special files are like most other files in many respects, and can be deleted if you have the permissions. But, in order to re-create this file, you should know the major and minor number associated with this character file.

[root@ldapserver /]# ll /dev/null
crw-rw-rw-. 1 root root 1, 3 Dec 18 2011 /dev/null

In my server, I have major-minor numbers for /dev/null as 1,3. But, what if somebody has already deleted this file, and you want to know the major and minor numbers for /dev/null so you can recreate this file.

If you have installed linux from source, then you should have devices.txt file on the following path

/usr/src/linux-3.1.6/Documentation/devices.txt

Open this file ‘devices.txt’ in any text editor and search for /dev/null. You will reach the following section:

  1 char        Memory devices
                  1 = /dev/mem          Physical memory access
                  2 = /dev/kmem         Kernel virtual memory access
                  3 = /dev/null         Null device
                  4 = /dev/port         I/O port access

From the above, you can see the 1 and 3 highlighted in yellow. ‘1’ is the major number and ‘3’ is the minor number. The major number specifies the major device type (for example, the device driver number). The minor number specifies the device location, which is typically, but not always, the unit, drive, and/or line number.

Now that you know the major and minor numbers associated with /dev/null, you can re-create this file as follows:

mknod -m 666 /dev/null c 1 3

mknod is used to create the character and block devices that populates ‘/dev/’. So, the above command is used to create a character (c) device file with major and minor pair of 1,3 and world writable.

Enjoy creating character and block device files. 🙂

Create an iso image of a folder

We all know how to create an iso image of a DVD using ‘dd’ command. But, what if you want to create an iso image of a folder containing lot of files?

Here the command mkisofs comes to our help. The usage is as follows:

mkisofs -o /{dest_dir}/{dest_file.iso} /{absolute path to the actual folder that you want to create the image}

eg: mkisoft -o /mnt/mycontent.iso /opt/rhel/media/

In the above example, an image ‘mycontent.iso’ will be created under ‘/mnt’ partition for the folder ‘media’. The option ‘-o’ means the output file.

Inode and Inumber

An inode is a data structure that contains important information regarding file within a file system. Whenever file system is created in UNIX, a set amount of inode is created. Usually, about 1% of the total file system disk space is allocated to the inode table.

Inode and Inumber (or Inode Number):

Inode and Inumber seems to be same, but they are not. Inode refers to the data structure and the inumber refers to the identification number of the inode. So, inumber is also referred to as inode number. The inode table contains a listing of all inode numbers for the respective file system. When users search for or access a file, the UNIX system searches through the inode table for the correct inode number. When the inode number is found, the command in question can access the inode and make the appropriate changes if applicable.

Take, for example, editing a file with vi. When you type vi , the inode number is found in the inode table, allowing you to open the inode. Some attributes are changed during the edit session of vi, and when you have finished and typed :wq, the inode is closed and released. This way, if two users were to try to edit the same file, the inode would already have been assigned to another user ID (UID) in the edit session, and the second editor would have to wait for the inode to be released.

How to check the inode number for any file?

[soj@centos ~]$ ls -i firewall.txt
458778 firewall.txt

[soj@centos ~]$ stat firewall.txt
File: `firewall.txt’
Size: 426 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 458778 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-01-23 08:36:57.000000000 -0800
Modify: 2012-01-23 08:36:52.000000000 -0800
Change: 2012-01-23 08:36:52.000000000 -0800

The inode contains all the information about a file except it’s actual file name and the file contents.
The following definitions provide just some of the important information contained in the inode that UNIX users employ constantly:

Inode number
Mode information to discern file type and also for the stat C function
Number of links to the file
UID of the owner
Group ID (GID) of the owner
Size of the file
Actual number of blocks that the file uses
Time last modified
Time last accessed
Time last changed

The information listed above is important to files and is used heavily in UNIX. Without this information, a file would appear corrupt and unusable. In UNIX, directories are actually files that have a few additional settings in their inodes. A directory is basically a file containing other files. Also, the mode information has flags set to inform the system that the file is actually a directory.