Red Hat Linux Enterprise 5
-
Upload
sreekaanth-ganesan -
Category
Documents
-
view
222 -
download
3
description
Transcript of Red Hat Linux Enterprise 5
![Page 1: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/1.jpg)
Red Hat Linux Enterprise 5
Trainer - Mohammed Usman Sharieff
![Page 2: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/2.jpg)
Unix - AT & T, Bell labs
HP Unix - HPAIX Unix - IBM
Solaris 10 – SUNFree or open source code -LINUX
![Page 3: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/3.jpg)
Flavours of Linux
SuSe Caldera
Mandrake Fedora
RedHat - most popular
![Page 4: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/4.jpg)
OS
Kernel – Core of the operating systemInteracts with hardware
Shell - bash shell ; command mode user interface
X windows system - GUI
![Page 5: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/5.jpg)
Run levels: different modes in which the OS can be booted
Init 0 shutdownInit 1 single user modeInit 2 multi user Init 3 multi user with networkingInit 4 un usedInit 5 multi user with networking
and GUI ( X windows system)Init 6 restart
![Page 6: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/6.jpg)
Understanding devices in Linux
/dev/hda h for ide device/dev/sda s for sata device
hda – a for primary masterhdb - b for primary slavehdc - c for secondary msterhdd - d for secondary slave
![Page 7: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/7.jpg)
Numbering of the partitions
Primary /dev/hda1/dev/hda2/dev/hda3
Extended /dev/hda4
Logical /dev/hda5/dev/hda6/dev/hda7and so on….
![Page 8: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/8.jpg)
Partitions required to install the RedHat Linux Enterprise 5
/boot 100MB /dev/hda1/ 5GB or greater /dev/hda2/swap 2 times of RAM /dev/hda3
/home home directory for users /dev/hda5
![Page 9: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/9.jpg)
Root refers to……
/ slash or root directory that contains the OS
Root also refers to root user (administrator)
$ normal user prompt# root user prompt
![Page 10: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/10.jpg)
Basic commands
ls ls-l date time clear man cd pwd
cp mv mkdir rm rmdir rm –r
vi filename touch filename gedit filename cat filename
useradd userdel passwd username head filename
more filename less filename ls-l>abc tail filename
su username su (for root) who whoami
hostname df –h df -T fdisk -l ifconfig -a
![Page 11: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/11.jpg)
Working with HDD
1. fdisk – for partitioningfdisk /dev/hda
2. mkfs – for formatingcreating the file system (ext2 or ext3)
mkfs /dev/hda5
3. mounting : to make it accessible under the /mount /dev/hda5 /apps
Any partition or drive that needs to be accessibleHas to be mounted under the / . So create a folder under /For this partition or drive and mount it under that folder.
![Page 12: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/12.jpg)
/etc directorycontains configuration files
/etc/inittab to change the run levels during boot
/etc/fstab for mounting partitions during boot
![Page 13: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/13.jpg)
HDD partitionsFdisk /dev/hdaMkfs /dev/hda5 (ext 2)
Mkfs.ext3 /dev/hda5Mkfs –t ext3 /dev/hda5
e2label /dev/hda5 /dataMkdir /dataMount /dev/hda5 /data
Vi /etc/fstab
LABEL=/data /data ext3 defaults 1 2or /dev/hda5 /data ext3 defaults 1 2
Blkid Blkid /dev/hda5
![Page 14: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/14.jpg)
Boot ProcessAfter Power on , POST , CMOS Setup, boot seq – HDD, MBR;GRUB …………………./boot contains boot loader, kernel and init
Boot loader – GRUBKernel and driversProcess – first process is Init /etc/rc.d/rc.sysinit
/etc/inittab /etc/rc.d/rc5.d/files K for kill scripts and s for start scripts
all files are linked to /init.d
![Page 15: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/15.jpg)
Volumesfdisk –lfdisk /dev/sdanst cylend cyl: 100MBtpart no 10code; 8ewreboot
fdisk –l create 11th partition
fdisk /dev/sdanst cylend cyl: 100MBwreboot
pvcreate /dev/sda11 /dev/sda12 /dev/sda13pvdisplayvgcreate pool1 dev/sda11 /dev/sda12 /dev/sda13vgdisplaylvcreate pool1 –L 150 -n datalvcreate pool1 –L 150 -n appslvdisplay
we need to format, mount and put entry in vi/etc/fstabdf -h
![Page 16: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/16.jpg)
pvcreate /dev/sda6 /dev/sda7 /dev/sda8pvdisplay
vgcreate pool1 /dev/sda6 /dev/sda7 /dev/sda8vgdisplay
lvcreate pool1 –L 152 -n datalvcreate pool1 –L 148 -n appslvdisplay
mkfs –t ext3 /dev/pool1/datamkfs –t ext3 /dev/pool1/apps
mkdir /datamkdir /apps
Vi /etc/fstab/dev/pool1/data /data ext3 defaults 1 2/dev/pool1/apps /apps ext3 defaults 1 2
![Page 17: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/17.jpg)
Create partitionConvert to physical volumevgextend pool1 /dev/sda15
Lvextend –L 1000 /dev/pool1/vol1
Previously vol1 was 600We have added 400
So to extend we have to giv e total 1000Then umount
Format and mount again
![Page 18: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/18.jpg)
Swap partitionfdisk –lfdisk /dev/sdanStart cylEnd cyltPart noCode : 82w
partprobeor reboot
mkswap /dev/sda8swapon /dev/sda8vi /etc/fstab/dev/sda8 swap swap Defaults 0 0
swapon –sfree
![Page 19: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/19.jpg)
Users and groupsUseradd userdel
groupadd groupdel
Usermod -G groupname username(adding users to the group)
Id username
![Page 20: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/20.jpg)
File permissions : chmod
d rwx rwx rwxFile/dir user group others
r w x4 2 1
chmod 777 filename ( 7 for user, group, others) chmod 750 filename (rwx for user, rx for group
and none for others)
![Page 21: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/21.jpg)
permissions
# chown username filename# chown : groupname filename# chown username : groupname filename
#chgrp groupname folder
![Page 22: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/22.jpg)
Umask - 0022
First mention umask then create the files.
If Umask is 022 folder perm is 755
if umask is 022 file perm should be 755since no execute (-111) the perm is 644 for files
execute for folder means to list (ls)
![Page 23: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/23.jpg)
Create directories, users and groups, give passwords to usersadd users to the groupgive permission for each folder to each groupdeny others access to the folders
mkdir sales mkdir itUseradd sales1 useradd it1Passwd sales1 passwd it1Groupadd sales groupadd it Usermod –G sales sales1 Usermod –G it it1Chgrp sales /data/sales chgrp it /data/itChmod 770 /data/sales chmod 770 /data/itChmod g+s /data/sales chmod g+s /data/it
![Page 24: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/24.jpg)
rpm rpm –ivh package rpm –U package… rpm - F package….
rpm –e (uninstall) (without .rpm)
yum install package (online) Yum upgrade package
Rpm –qa rpm –q sambaFrom CD to /usr/src/redhat
![Page 25: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/25.jpg)
# bzip2 filename # gzip filename# bzip2 –d filename #gzip –d filename
(-d decompress)
mv a .a (creating hidden file)ls –all (listing hidden files also)
ln (copy and link)
mkdir /data1mkdir /data2Cd data1, vi exln ex /data2/ex
![Page 26: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/26.jpg)
Networkingifconfig –a Unix OSIpconfig/all MS WindowsNetconfig Novell netware
Ifconfig eth0 up
ifconfiig eth0 10.0.0.10Ifconfig eth0 downservice network restart
vi /etc/sysconfig/network-scripts/ifcfg-eth0Change the ip esc :wq
service network restart
![Page 27: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/27.jpg)
Services Service network restartService network stopService network startService iptables status
Service autofs status/etc/sysconfig/autofs
chkconfig autofs on (will tick the service in the tool system-config-services)
![Page 28: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/28.jpg)
Nis – authentication (similar to ADS of MS or NDS of novell
nfs – sharing (between unix )
samba – (sharing between unix and MS pcs)
apache – web server (similar to IIS of MS)
bind – dns – named server
dhcp - (automatic configuration of ip, dg, dns)
ftp (file upload and download)
telnet (remote access)
![Page 29: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/29.jpg)
nfs configuration on the Serverrpm –ivh nfs…..rpm
service nfs start
vi /etc/exports/data 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)
exportfs –rv
service portmap restart service nfs restart
Chkconfig nfs on
![Page 30: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/30.jpg)
Client configuration for nfs
vi /etc/fstab ipaddress : /data /data nfs defaults 0 0computername : /data /data nfs defaults 0 0
Example: srv1:/home /home nfs defaults 0 0
Vi /etc/hosts (if servername is used)ip computername
![Page 31: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/31.jpg)
Basic commandsTAR tar cvf test.tar test
tar xvf test.tar
c-create x – extract f - file
Attributes : lsattr chattr
chattr +i filename (cannot delete or rename)
i-immutable
ls –R (list sub directories and files – tree )rm -r (remove all subdirec and files )rmdir for empty directories
cat /proc/cpuinfo
![Page 32: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/32.jpg)
Piping - grepFind Locate
Grep name /etc/passwdEgrep
ps –e | moreEgrep : /etc/passwd |more
ls –l | more
![Page 33: Red Hat Linux Enterprise 5](https://reader036.fdocuments.us/reader036/viewer/2022081513/563db949550346aa9a9bde89/html5/thumbnails/33.jpg)
Troubleshooting
Mount –o remount,rw /