web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

December 23, 2007

password length problems in linux

Filed under: des, encryption, linux, password — unni @ 1:01 pm

Some times you may have faced a situation in which you can use the first 8 letters of your password for server login even though your actual password length is more than 8 character.

This occurs because of the method of encryption used in linux system. The DES http://en.wikipedia.org/wiki/Data_Encryption_Standard is used in many system to encrypt password uses only 8 characters, rest of the characters doesn’t matters in DES. So anyone can login using first 8 characters of the password.

The solution is to change the encryption method.

1. Run the command “setup” in command prompt

authentication config

2. Select “Authentication configuration” and press “run tool” button
3. In Authentication section select “Use MD5 passwords.

authentication conf

6. press ok and change the password using “passwd” command.

that will fix the issue. :-)

November 18, 2007

Mount LVM Partitioned Disk

Filed under: linux, lvm — vivek @ 10:27 am

1. Check the LVM partitioned disk

fdisk -l

Example

[root@server ~]# fdisk -l

Disk /dev/hda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14         267     2040255   82  Linux swap
/dev/hda3             268       10011    78268680   83  Linux

Disk /dev/hdc: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1          13      104391   83  Linux
/dev/hdc2              14       10011    80308935   8e  Linux LVM

Clearly from the last line /dev/hdc2 had partitioned in lvm format

Note: The module dm-mod should be compiled in with the kernel to support lvm format, check this using

lsmod

and if not present add the modules using

modprobe dm-mod

(When configuring the kernel, make sure to configure the kernel to support LVM)
2. Check for volume groups (VG)

vgscan

Example

[root@server ~]# vgscan
 Reading all physical volumes.  This may take a while...
 Found volume group "VolGroup00" using metadata type lvm2

Here the available volume group is VolGroup00, it may be different (say vg0 ) as setup in a disk. If there are more than one volume group they may be named as VolGroup01 or vg1, VolGroup02 or vg2 …
3. Check for physical volumes (PV)

pvscan

Example

[root@server ~]# pvscan
  PV /dev/hdc2   VG VolGroup00   lvm2 [76.56 GB / 32.00 MB free]
  Total: 1 [76.56 GB] / in use: 1 [76.56 GB] / in no VG: 0 [0   ]

4. Activate the volume group

vgchange VolGroup00 -a y

Example

[root@server ~]# vgchange VolGroup00 -a y
  2 logical volume(s) in volume group "VolGroup00" now active

The above command actually make the volume group VolGroup00 known to the kernel and after this the device is mapped to the logical volumes in volume groups. If there are more than one volume group and want to activate all, we have to modify the command as below

vgchange -a y

As per the output in the above example two logical volumes are active, we can verify as follows

[root@server ~]# cd /dev/VolGroup00/
[root@server VolGroup00]# ll
total 0
lrwxrwxrwx  1 root root 31 Jun 29 10:33 LogVol00 -> /dev/mapper/VolGroup00-LogVol00
lrwxrwxrwx  1 root root 31 Jun 29 10:33 LogVol01 -> /dev/mapper/VolGroup00-LogVol01

5. Mount the partition

mkdir /mnt/old
mount /dev/VolGroup00/LogVol00 /mnt/old

Example

[root@server ~]# mount /dev/VolGroup00/LogVol00 /mnt/old/
[root@server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3              74G   16G   55G  22% /
/dev/hda1              99M   17M   77M  18% /boot
/usr/tmpDSK           485M   13M  447M   3% /tmp
/tmp                  485M   13M  447M   3% /var/tmp
/dev/mapper/VolGroup00-LogVol00
                       74G   16G   54G  23% /mnt/old

July 11, 2007

finding the distro name of linux

Filed under: linux — unni @ 6:39 am

Here is some tips to find out which is your linux distro

Use commands

cat /proc/version

cat /etc/issue

dmesg | head -1

use script

#/bin/bash
#by www.webofunni.co.nr
kernel=`uname -r`
machine=`uname -m`
if [ -f /etc/redhat-release ] ; then
distro=`cat /etc/redhat-release`
elif [ -f /etc/SuSE-release ] ; then
distro=`cat /etc/SuSE-release`
elif [ -f /etc/mandrake-release ] ; then
distro=`cat /etc/mandrake-release`
elif [ -f /etc/debian_version ] ; then
distro=`cat /etc/debian_version`
fi
echo -e “Your distro : ${distro} \nKernel version : ${kernel} \nmachine : ${machine}”

Created and maintained by Unnikrishnan
Hosted by Host cats