41
Boot Process: 1. The system BIOS checks the system and launches the first stage boot loader on the MBR of the primary hard disk. 2. The first stage boot loader loads itself into memory and launches the second stage boot loader from the /boot/ partition. 3. The second stage boot loader loads the kernel into memory, which in turn loads any necessary modules and mounts the root partition read- only. 4. The kernel transfers control of the boot process to the /sbin/init program. 5. The /sbin/init program loads all services and user-space tools, and mounts all partitions listed in /etc/fstab. 6. The user is presented with a login screen for the freshly booted Linux system. Config Files – Boot Process /boot/grub/grub.conf and /etc/grub.conf This is the booting file of linux #vim /boot/grub/grub.conf boot=/dev/vda default=0 = Which OS to be loaded at the time of booting Tmeout=5 Splashimage appearance of grub menu Hidden menu grub options are hidden Run Levels Vim /etc/inittab 0 - halt (Do NOT set initdefault to this) 1 - Single user mode 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 3 - Full multiuser mode 4 - unused 5 - X11 6 - reboot (Do NOT set initdefault to this)Vim /etc/inittab (id:5:initdefault: :wq!) id:5:initdefault:

Linux Boot Process

Embed Size (px)

DESCRIPTION

Linux commands

Citation preview

Boot Process:1. The system BIOS checks the system and launches the first stage boot loader on the MBR of the primary hard disk.2. The first stage boot loader loads itself into memory and launches the second stage boot loader from the /boot/ partition.3. The second stage boot loader loads the kernel into memory, which in turn loads any necessary modules and mounts the root partition read-only.4. The kernel transfers control of the boot process to the /sbin/init program.5. The /sbin/init program loads all services and user-space tools, and mounts all partitions listed in /etc/fstab.6. The user is presented with a login screen for the freshly booted Linux system.Config Files Boot Process/boot/grub/grub.conf and /etc/grub.conf This is the booting file of linux#vim /boot/grub/grub.confboot=/dev/vdadefault=0 = Which OS to be loaded at the time of bootingTmeout=5Splashimage appearance of grub menuHidden menu grub options are hiddenRun LevelsVim /etc/inittab0 - halt (Do NOT set initdefault to this)1 - Single user mode2 - Multiuser, without NFS (The same as 3, if you do not have networking)3 - Full multiuser mode4 - unused5 - X116 - reboot (Do NOT set initdefault to this)Vim /etc/inittab (id:5:initdefault: :wq!)id:5:initdefault:For detecting new lunsecho "- - - " > /sys/class/fc_host/host0/issue_lip ====> For scanning the hba card and newly created zoneecho "1" > /sys/class/fc_host/host0/issue_lipecho "- - -" > /sys/class/scsi_host/host0/scan ===> For detecting the nwlunecho "- - -" >> /sys/class/scsi_host/host1/scanrescan-scsi-bus.sh -l -w ===> For detecting new lunsfdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' |wc l ===> List the total disksfdisk -l 2>/dev/null | egrep '^/dev/sd' |wc -l ==> List the total disks(using /dev/sd id)echo 1 > /sys/block/sdo/device/delete ===> Remove LUN from system.# grep sdo /proc/partitions ==> Then check whether it removed pointers to both sdo and sdo1For detecting new hardware :kudzuLinux Disk Partioningfdisk l To display the disk configurationfdisk /dev/vda To get in to the specified disk configurationfdisk Cu /dev/vda To get in with depressive modefdisk /dev/vdaP= print the partion table, n= To create new disk, d= delete a partition, m= print this menu, q= quit without saving, t= change a partition system ID, w= write table to disk and exitfdisk cu /dev/vda n, select extended or PrimaryPrimary can be 3(3primary+1 externded)Select P for primary partition and e for extended partitionFirst cylinder (enter or provide valid next cylinder number)Last cylinder number (provide the size eg: +100G for 100gb partition)w= To save changes and exittrypartprobe or partx (without restart ,but it wont work in after rhel5)[root@MDCLINUXVIRT ~]# fdisk /dev/sdbCommand (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-13054, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054): +6GCommand (m for help): pDisk /dev/sdb: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 730 5863693+ 83 LinuxCommand (m for help): nCreate sdb2 & sdb3 in same steps.Command (m for help): pDisk /dev/sdb: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 730 5863693+ 83 Linux/dev/sdb2 731 1704 7823655 83 Linux/dev/sdb3 1705 2434 5863725 83 LinuxCommand (m for help): n==========================================> Out of 4, 3 primary partition can create. 4th one is using for extended. Then extended will split into logical partition.Command actione extendedp primary partition (1-4eSelected partition 4First cylinder (2435-13054, default 2435):Using default value 2435Last cylinder or +size or +sizeM or +sizeK (2435-13054, default 13054):Using default value 13054Command (m for help): pDisk /dev/sdb: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 730 5863693+ 83 Linux/dev/sdb2 731 1704 7823655 83 Linux/dev/sdb3 1705 2434 5863725 83 Linux/dev/sdb4 2435 13054 85305150 5 ExtendedCommand (m for help): nFirst cylinder (2435-13054, default 2435):Using default value 2435Last cylinder or +size or +sizeM or +sizeK (2435-13054, default 13054): 40 +40GCommand (m for help): pDisk /dev/sdb: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 730 5863693+ 83 Linux/dev/sdb2 731 1704 7823655 83 Linux/dev/sdb3 1705 2434 5863725 83 Linux/dev/sdb4 2435 13054 85305150 5 Extended/dev/sdb5 2435 7298 39070048+ 83 LinuxCommand (m for help): nFirst cylinder (7299-13054, default 7299):Using default value 7299Last cylinder or +size or +sizeM or +sizeK (7299-13054, default 13054): +1GCommand (m for help): pDisk /dev/sdb: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 730 5863693+ 83 Linux/dev/sdb2 731 1704 7823655 83 Linux/dev/sdb3 1705 2434 5863725 83 Linux/dev/sdb4 2435 13054 85305150 5 Extended/dev/sdb5 2435 7298 39070048+ 83 Linux/dev/sdb6 7299 7421 987966 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.The kernel still uses the old table.The new table will be used at the next reboot.Syncing disks.[root@MDCLINUXVIRT ~]# sync[root@MDCLINUXVIRT ~]# partprobe[root@MDCLINUXVIRT ~]# mkfs.ext3 /dev/sdb1[root@MDCLINUXVIRT ~]#[root@MDCLINUXVIRT ~]#mount /dev/sdb1 /mnt/etc/fstab Entry==> Device to Mount : Mount Point : FS Type : Mount Option : FSCK Pass : dev/vda3 /new ext4 defaults(r,rw) 0 0 (0=dump frequency ,0=fs check)(0= Nobackup, 1=everyday backup, 2=Alternate day backup) (0= Ignore, 1= All boot time, 2= Alternate booting)How to create an encrypted partitionCreate a normal partition for encrypted partitioncryptsetupluksFormat /dev/vda5 To make this FS for encryptedCryptsetupluksOpen /dev/vda5 ipsr To generate encrypted (note: ipsr= it is an simple name for identification )Mkfs t ext4 /dev/mapper/ipsrMkdir /secretMount /dev/mapper/ipsr /secretDf h, ls /secretCryptsetupluksCloseipsrTo remove/close from encryptionUpdate in /etc/fstab To make permanent .Vim /etc/crypttab Update here also to make permanentIpsr /dev/vda5 So each and every time when the server gets reboot ,it will ask for the password to proceed with mounting of the particular FS.Setting password in crypttab file for automatic mounting when the server reboot.Vim /etc/crypttabIpsr /dev/vda5 /root/mypassword:wq!Echo redhat> /root/mypassword It will set the password as redhat by creating a file /root/mypassword for encrypted FSChown root /root/mypassword, chmod 600 /root/mypassword, ls l /root/mypasswordCryptsetupluksAddKey /dev/vda5 /root/mypasswordTo add the password key for encryptionE2label /dev/mapper/ipsr new To labelVim /etc/fstabLABEL=new :wq!blockdev -getra /dev/sdb For increasing the HDD performanceBreaking Root Password:After rebooting, select any key to go to menu type e Select second line, starting with kernel and type e and go to end of last line and type S press enter and will be in kernel prompt, ie 2nd line type bIt will come in single user modepasswd root change root passwdLVM (Logical Volume Manage)*LVM wont support /boot*Create a partition in normal way(m for help) : t To change the partition type5 select the partition numberCode: 8e , : p to print the partition table, :w To save and exitSingle LUN LVM Creation:pvcreate /dev/mapper/mpathacpvcreate /dev/sdbvgcreate data_vg /dev/mapper/mpathacvgcreate data_vg /dev/sdb5create a new vg with default PEVgcreate s 8M newvg /dev/sdb5 To create VG with mentioning 8mb Physical Extend(PE)Vgchange s 4M newvg To change PE sizelvcreate L 100G n data_lv data_vg To create 100GB LVlvcreate l 10 n newlv newvg It will take the size as (10*8M of PE)lvcreate -l 100%FREE -n data_lv data_vg By taking the full size of vgmkfs.ext3 /dev/mapper/vg_data_3-lv_data_3mount /dev/mapper/vg_data_3-lv_data_3 /data3PV (Physical Volume)pvcreate /dev/sdbpvspvdisplaypvscan scans for disks for non-LVM and LVM diskspvs -a -o +devices Listing detailed information of pvs.pvremove /dev/sdepvmove /dev/sde /dev/sdf Moving the data from faulty disk to new diskVG (Volume Group)vgcreate data_vg /dev/sdbvgsvgdispalyvgscanvgextend data_vg /dev/sdcvgreduce data_vg /dev/sdcvgreduce removemissing force vg_datavgs a o +devices Listing detailed information of vgsvgs flags:#PV - number of physical devices#LV - number of configured volumes

vgs attributes are: 1. permissions (r)|(w)2. resi(z)eable3. e(x)ported4. (p)artial5. allocation policy - (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited6. (c)luster## Backup to default location (/etc/lvm/backup) vgcfgbackup VolData00

# Backup to specific location vgcfgbackup -f /var/backup/VolData00_bkup VolData00# Backup to specific location all volume groups (notice the %s)vgcfgbackup -f /var/backup/vg_backups_%s

vgcfgrestore -f /var/backup/VolData00_bkup VolData00

Common Attributes that you may want to use:-l list backups of file-f backup file-M metadataype 1 or 2Exporting and Importing VG:vgexport VolData00vgimport VolData00Reducing the vg... When the physical disk removingumout /fspvremove pv_namevgreduce --removemissing vg_nameLVM (Logical Volume Manager)lvslvdisplaylvdisplay maps Display Mirror Volumeslvcreate L 100G n lv_name vg_namelvcreate l 10 n newlv newvg It will take the size as (10*8M of PE)lvcreate -l 100%FREE -n data_lv data_vg By taking the full size of vglvchange -a n /dev/vg0/lv0 Disabling the LVM partition from usage.lvchange -a y /dev/vg0/lv0 Enabling the LVM partition from usage.lvrename /dev/VolData00/vol_old /dev/VolData00/vol_newlvs a o +devices Detailed information of lvslvs attributes are: 1. volume type: (m)irrored, (M)irrored without initail sync, (o)rigin, (p)vmove, (s)napshot, invalid (S)napshot, (v)irtual, mirror (i)magemirror (I)mage out-of-sync, under (c)onversion2. permissions: (w)rite, (r)ead-only3. allocation policy - (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited4. fixed (m)inor 5. state: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, mapped (d)evice present with-out tables, mapped device present with (i)nactive table 6. device (o)pen (mounted in other words)LVM Extensionpvcreate /dev/hde1vgextend data_vg /dev/hde1lvextend -L +100G /dev/data_vg-pgsql_volresize2fs /dev/data_vg-pgsql_volLVM ReducingReducing the mount point /apps from 100G to 50Gumount /appse2fsck -f /dev/vg_app/lv_appresize2fs /dev/vg_app/lv_app 110GlvreduceL 110G /dev/vg_app/lv_appmount /dev/vg_app/lv_app /apps/LVM Removing (mountpoint /data3)umount /data3lvremove /dev/mapper/vg_data3-lv_data3vgremove vg_data3pvremove /dev/mapper/mpathaaAdding the new disk to vg vg_apppvcreate /dev/vddvgextend vg_app /dev/vddFaulty Disk Replacement Procedure in LVMpvcreate /dev/sdf Creating the pv of new diskvgextend vg_app /dev/sdfpvmove /dev/sde /dev/sdf Moving the data from faulty disk to new diskpvremove /dev/sdevgreduce removemissing vg_appdmsetup info Its a low level logical volume management. For getting details of the all LVM fs on the server.[root@IETEST ~]# dmsetup infoName: VolGroup00-data_lvState: ACTIVEdmsetup suspend VolGroup00-data_lvdmsetup resume VolGroup00-data_lvHow to create LV snapshotLvcreate s -L 20M n snap /dev/newvg/newlv To take snapshotLs /dev/newvg To check the snapshot(* delete file to check, unmount Fs umount /data)Lvchange an /dev/newvg/newlv To deactivate lvLvchange ay /dev/newvg/newlv To activate lvLvconvert merge /dev/newvg /snapMount a## a striped volume called lvol1 (note the captial i for the stripe size), can use -l (extents) instead of -L lvcreate -i 3 -L 24M -n lvol1 vg01## Mirrored volumelvcreate -L 10M -m1 -n data01 vg01

-------------------------------------------------------------------------------------------------------------------------------------## Mirrored volume without a mirror log filelvcreate -L 10M -m1 --mirrorlog core -n data01 vg01Common Attributes that you may want to use:-L size of the volume [kKmMgGtT]-l number of extents-C contiguous [y|n]-i stripes-I stripe size-m mirrors--mirrorlog -n volume name##adding a mirror to a non-mirrored volumelvconvert -m1 --mirrorlog core /dev/VolData00/vol01 /dev/sdb2##removing a mirror from a mirrored volumelvconvert -m0 /dev/VolData00/vol01 /dev/sdb2##Mirror a volume that has stripeslvconvert --stripes 3 -m1 --mirrorlog core /dev/VolData00/data01 /dev/sdd1 /dev/sde1 /devsdf1##snapshotlvcreate --size 100M --snapshot -name snap /dev/vg01/data01To List the HBA Card Detailssystool -c fc_host -v==> To Check FC info, WWNsystool -c fc_transport -v==> To Check FC info, WWNsystool -c fc_remote_ports vsystool -c fc_vports vListing the HBA card wwwn No:bash-4.1# cd /sys/class/fc_host/host1bash-4.1# cat node_name0x20000000c9fc8af5To check the LUN id of the diskmultipath -ll/dev/disk/by-idMultipathing - RHEL6# mpathconf --enable --with_multipathd y#multipath -llSteps for Configuring MulitpathPackage Required: device-mapper-multipathConfig File:/etc/multipath.confOR/usr/share/doc/device-mapper-multipath-0.4.9/multipath.confIf you do not need to edit the/etc/multipath.conffile, you can set up DM-Multipath for a basic failover configuration by running the following command. This command enables the multipath configuration file and starts themultipathddaemon.# mpathconf --enable --with_multipathd yIf you need to edit the/etc/multipath.conffile before starting themultipathddaemon. use the following procedure to set up DM-Multipath for a basic failover configuration.# mpathconf enableEdit the/etc/multipath.conffile if necessary. The default settings for DM-Multipath are compiled in to the system and do not need to be explicitly set in the/etc/multipath.conffile.The default value ofpath_grouping_policyis set tofailover, so in this example you do not need to edit the/etc/multipath.conffile. For information on changing the values in the configuration file to something other than the defaultsSave the configuration file and exit the editor, if necessary.Execute the following command:# service multipathd startIf you find that you need to edit the multipath configuration file after you have started the multipath daemon, you must execute thebelow command for the changes to take effect.#service multipathd reloadBlack Listing Device by WWID#vi /etc/multipath.confblacklist { wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1}# service multipathd reload

Run the following command to remove the multipath device: #multipath -f SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1

In the o/p of #mulitpath -ll, above mentioned device will not list.

Setting Up Multipathing in the initramfs File SystemYou can set up multipathing in theinitramfsfile system. After configuring multipath, you can rebuild theinitramfsfile system with the multipath configuration files by executing thedracutcommand# dracut --force --add multipath --include /etc/multipath /etc/multipathIf you run multipath from theinitramfsfile system and you make any changes to the multipath configuration files, you must rebuild theinitramfsfile system for the changes to take effect.Rebuilding Initial Ramdisk Image (initramfs)Rebuilding the initrd (RHEL 3, 4, 5)It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem:$ cp /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r).img.$(date +%m-%d-%H%M%S).bakHere: $ cp /boot/initrd-2.6.32-220.el6.i686kdump.img $ cp /boot/initrd-2.6.32-220.el6.i686kdump.img.25102014.bakNow build the initrd:$ mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)The -v verbose flag causes mkinitrd to display the names of all the modules it is including in the initial ramdisk.The -f option will force an overwrite of any existing initial ramdisk image at the path you have specifiedIf you are in a kernel version different to the initrd you are building (including if you are in Rescue Mode)you must specify the full kernel version, without architecture:$ mkinitrd -f -v /boot/initrd-2.6.18-348.2.1.el5.img 2.6.18-348.2.1.el5Rebuilding the initramfs (RHEL 6, 7)It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem:$ cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.$(date +%m-%d-%H%M%S).bakHere: $ cp /boot/initramfs-2.6.32-220.el6.i686.img /boot/initramfs-2.6.32-220.el6.i686.img.10-25-125700.bakNow rebuild the initramfs for the current kernel version:$ dracut -f -vIf you are in a kernel version different to the initrd you are building (including if you are in Rescue Mode)you must specify the full kernel version, including architecture:$ dracut -f /boot/initramfs-2.6.32-220.7.1.el6.x86_64.img 2.6.32-220.7.1.el6.x86_64Taking OS Backup (Native Tool)dump -0u -f /backup/varbkp /varrestore i f /backup/varbkprsync -aAXv /* /backup/ --exclude={/dev/*,/proc/*,/sys/*,/run/*,/media/*,/lost+found} Backuprsync -aAXv /backup/* / --exclude=boot = RestoreManage system softwareRPM- Redhat Package Managementrpm qa To check the rpmrpm e To uninstall rpmrpm ivh To install rpmrpm qf /usr/sbin/vsfpd To know the rpm integrated with this packagerpm qpl It will display all the integrated location for that package or servicerpm-Uvh vsftpd To update the packagerpm ivh nodeps force To install forcefully without dependencyrpm qi vsftpd To check more about the packagesysstat-9.0.4-20.el6.x86_64 = RPM using for system performance monitoring commands. mpstat,saretcYUMyum repolistyum clean all To clean yumyum install samba To install packageyum update It will update all available rpmyum list update It will list all new updated packagesyum update It will update only mentioned packageyum list all It will list all files in repoyum remove samba To uninstall a packageyum info To know about a packageyum grouplistallyum groupinstall Directory Clientyum groupremoveyum search createrepo /var/ftp/pub/rhel/dvd To generate/create repoyum whatprovides */libldap-2.3.so.0 ==> To find the package related to file libldap-2.3.so.0Here Its package is: compat-openldap-2.3.43-2.el6.i686Yum Group Repo Creation:#rpm qa |grep I yum-utlisGo to the repodata dir of CD/ISO image(/media/Packages/repodata), and copy to the local repo path (/backup/packages)#cp *-comps-rhel6-Server.xml /backup/packages/comps.xml

Then, create repo group.#cd /backup/packages#createrepo -g comps.xml /backup/packages#yum clean all#yum grouplistYum Repo Creation Procedure Locally in RHELServer Side:#copy all rpms in /var/ftp/pub/cdromInstall the rpm createrepo-0.9.8-4.el6.noarch.rpmfor executing createrepo command also install its dependency packagesdeltarpm and python-deltarpm#createrepo /var/ftp/pub/cdrom/#cd /etc/yum.repos.d==>vi example.repo[unixreposerver]name=linux repobaseurl=file:///var/ftp/pub/cdromenabled=1gpgcheck=0If we are getting public key for package xxxx is not installed error, change the gpcheck value and give the key.gpcheck=1gpkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releaseAlso execute the command #rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releaseOR#copy all rpms in /var/www/html/pub/cdrom#createrepo /var/www/html/pub/cdrom#cd /etc/yum.repos.d==>vi example.repo[unixreposerver]name=linux repobaseurl=http://10.0.7.50/pub/cdromenabled=1gpgcheck=0Creating Repo Server - By keeping Repodata in Different Path#Here copying all packages in /yum-repocreaterepo /yum-repo# vi /etc/httpd/conf.d/repo.confAlias /repo/ "/yum-repo/"#service httpd start#vi /etc/yum.repos.d/local.repo[Localrepo]name=RHEL6.2 Repobaseurl=http://10.1.46.81/repo/enabled=1gpgcheck=1######################################################################For importing gpgcheck key from iso mount point /mnt. It is required if gpgcheck=1rpm --import /mnt/RPM-GPG-KEY-redhat-releaserpm --import /mnt/RPM-GPG-KEY-redhat-beta######################################################################elinks http://10.1.46.81/repo/repodata/repomd.xml ==> For cheking through browserClient Side:#yum clean all ==> Clean all repos#yum repolist ==> refreshing teh repolist by reading /etc/yum.repos.d/linuxhttp.repo file[root@PKICK01 yum.repos.d]# pwd/etc/yum.repos.d[root@PKICK01 yum.repos.d]# cat linuxhttp.repo[unixreposerver]name=linux repobaseurl=http://10.0.7.50/pub/cdromenabled=1gpgcheck=0Yum Repo Creation Procedure RHEL Networkhttps://access.redhat.com/homeLogin: futuregroup_redhatPswd: Redhat123Go to Subscriptions and remove the existing clientUpdate the below entry in /etc/sysconfig/rhn/up2date file of server1. proxyPassword=temproot2. proxyUser=unix-patch3. httpProxy=10.0.4.11:31284. enableProxyAuth=15. enableProxy=1# rhnreg_ks --username=futuregroup_redhat --password=Redhat123 Command for registeringDownloading rpm from YUM RepoDownloadonly plugin for yumInstall the package including "downloadonly" plugin:(RHEL5)# yum install yum-downloadonly(RHEL6)# yum install yum-plugin-downloadonlyRun yum command with "--downloadonly" option as follows:# yum install --downloadonly --downloaddir=Confirm the RPM files are available in the specified download directory.YumdownloaderIf downloading a installed package, "yumdownloader" is useful.Install the yum-utils package:# yum install yum-utilsRun the command followed by the desired package:# yumdownloaderRedhat Package Rollback (Yum & RPM)RHEL5 /CentOSWe can setup a RPM rollback using two simple steps on Centos 5 or RHEL5,Step 1)Create a file called macros [root@kernelmount ~]# cat /etc/rpm/macros%_repackage_all_erasures 1

Step 2)Add tsflags=repackage line at end of yum configuration file, [root@kernelmount ~]# tail -1 /etc/yum.conf tsflags=repackageInstall the package / yum updateCheck the rpm backup for reinstalling old packages#ls -l /var/spool/repackage

ROLL back RPM:If OS updated with in one hour period#rpm -Uvh --rollback '1 hour ago'

if yesterday #rpm -Uvh --rollback '1 day ago'

if OS updated on a week ago,#rpm -Uvh --rollback '1 week ago'

if OS update on Mar 20th,#rpm -Uvh --rollback 'March 20'---------------------------------------------------------------------------------------------------------------------------------------RHEL6 :To check all theprevious history ofRPMinstallation/update:# yum history output will be belowID | Login user | Date and time | Action(s) | Altered-------------------------------------------------------------------------------47 | root | 2012-05-27 09:03 | Install | 4 To list/info/summary of 47th transactions#yum history list 47 / # yum history info 47 / # yum history summary 47To ROLLBACK All RPM'S in the particular transaction: ( To erase installed packages and To Install uninstalled packages)# yum history undo 47To reinstall the rpm's which are erased via undo option:# yum history redo 46Yum database location:# ls -ltr /var/lib/yum/yumdb/Exporting Proxy:export http_proxy=unix-patch:[email protected]:3128Service Administrationservice network statusservice iptables restart/stop/start/etc/init.d/network status/etc/init.d/iptables restart/stop/startchkconfig --list | grep -i iptables Listing permanent service status, after rboot also.chkconfig network on To on network service permanentlychkconfig network off To off network service permanentlychkconfig network --level 1 off For making network service off on run level1Selinux is an kernel level security, it is developed by NSAgetenforceTo check selinux modesestatus To check selinux statusEnforce=1=enablePermissive=0=Disablesetenforce 0 disabling selinux#vi /etc/sysconfig/selinuxSELINUX=disabledNetwork Administrationsystem-config-network To enter to the network setup GUIsetup To enter to the network setup GUInmap localhostnmap 10.0.7.50 To check the opened port in the serverip route It will show the ip tables in linuxdig t 10.0.7.50 It will show details with DNS servers/etc/resolv/conf DNS servers details need to be updated herenetstat -tunlp |grep -i 21 To chek wheather the mentioned port is openednetstat tunlp To see all the opened ports in the serverHostname Change:# cat /etc/sysconfig/networkNETWORKING=yesHOSTNAME=PAVXDX513# cat /etc/hosts10.0.26.31 PAVXDX513ORsysctl kernel.hostname=NEW-HOSTNAMEIP ConfigurationNormal Configuration# cat /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0HWADDR=00:0C:29:CF:F3:CBIPADDR=10.15.1.3NETMASK=255.255.255.0GATEWAY=10.15.1.1ONBOOT=yesip link To list the NICethtool eth0 To list the properties of the NIC eth0mii-tool eth0 To list the propertiesmii-tool -F 100baseTx-HD Setting parameter by using mii-toolethtool -s eth0 speed 100 duplex full Setting the speed =100 and duplex=full for the interface eth0For making these settings permanently. Append the below line in ifcfg-eth0 file# vi /etc/sysconfig/network-scripts/ifcfg-eth0ETHTOOL_OPTS="speed 100 duplex full autoneg off"Bonding Without VLAN:1 .Create a Bond0 Configuration File:#cat /etc/sysconfig/network-scripts/ifcfg-bond0DEVICE=bond0

IPADDR=192.168.1.20

GATEWAY=192.168.1.1

NETMASK=255.255.255.0

USERCTL=no

BOOTPROTO=none

ONBOOT=yes2: Modify the existing eth0 and eth1 config #cat /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none#cat /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none3: Load bond driver/modul # vi /etc/modprobe.d/bonding.conf Append following two lines:alias bond0 bondingoptions bond0 mode=balance-alb miimon=100 or options bond0 mode=1 miimon=1004: Test configuration modprobe bonding Restart the networking service in order to bring up bond0 interface, enter:service network restart5.Type the following command to query the current status of Linux kernel bonding driver, enter:#cat /proc/net/bonding/bond0

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 200

Down Delay (ms): 200

Slave Interface: eth0

MII Status: up

Link Failure Count: 0

Permanent HW addr: 00:0c:29:c6:be:59

Slave Interface: eth1

MII Status: up

Link Failure Count: 0Permanent HW addr: 00:0c:29:c6:be:63Bonding With VLAN-bash-4.1# ifconfig -abond0 Link encap:Ethernet HWaddr 34:40:B5:BE:E4:28 inet6 addr: fe80::3640:b5ff:febe:e428/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:40731847707 errors:280 dropped:926099 overruns:1300 frame:280 TX packets:49259824458 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:37135621905390 (33.7 TiB) TX bytes:54652939045444 (49.7 TiB)bond0.8 Link encap:Ethernet HWaddr 34:40:B5:BE:E4:28 inet addr:10.0.8.127 Bcast:10.0.8.255 Mask:255.255.255.0inet6 addr: fe80::3640:b5ff:febe:e428/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:11315035341 errors:0 dropped:0 overruns:0 frame:0 TX packets:2667122919 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:525210854463 (489.1 GiB) TX bytes:33132625305174 (30.1 TiB)bond0.26 Link encap:Ethernet HWaddr 34:40:B5:BE:E4:28 inet addr:10.0.26.31 Bcast:10.0.26.255 Mask:255.255.255.0inet6 addr: fe80::3640:b5ff:febe:e428/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:29416812366 errors:0 dropped:0 overruns:0 frame:0 TX packets:18088898934 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:36040165183029 (32.7 TiB) TX bytes:21474031324178 (19.5 TiB)eth0 Link encap:Ethernet HWaddr 34:40:B5:BE:E4:28 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:40678183871 errors:140 dropped:926099 overruns:1300 frame:140 TX packets:49259824459 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:37131672317972 (33.7 TiB) TX bytes:54652939046542 (49.7 TiB)eth1 Link encap:Ethernet HWaddr 34:40:B5:BE:E4:28 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:53663836 errors:140 dropped:0 overruns:0 frame:140 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:3949587418 (3.6 GiB) TX bytes:0 (0.0 b)-bash-4.1# cat /etc/sysconfig/network-scripts/ifcfg-bond0DEVICE=bond0BOOTPROTO=noneUSERCTL=noONBOOT=yes-bash-4.1# cat /etc/sysconfig/network-scripts/ifcfg-bond0.8DEVICE=bond0.8VLAN=yesONBOOT=yesIPADDR=10.0.8.127NETMASK=255.255.255.0USERCTL=noTYPE=ETHERNET-bash-4.1# cat /etc/sysconfig/network-scripts/ifcfg-bond0.26DEVICE=bond0.26VLAN=yesONBOOT=yesIPADDR=10.0.26.31NETMASK=255.255.255.0USERCTL=noGATEWAY=10.0.26.1TYPE=ETHERNET-bash-4.1# cat /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0NM_CONTROLLED=noONBOOT=yesMASTER=bond0SLAVE=yesTYPE=EthernetBOOTPROTO=noneUSERCTL=noHWADDR=34:40:b5:be:e4:28IPV6INIT=no--bash-4.1# cat /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1NM_CONTROLLED=noONBOOT=yesTYPE=EthernetMASTER=bond0SLAVE=yesBOOTPROTO=noneUSERCTL=noHWADDR=34:40:b5:be:e4:2cIPV6INIT=no-bash-4.1# cat /etc/modprobe.d/bonding.confalias bond0 bondingoptions bond0 mode=1 miimon=100-bash-4.1# cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (active-backup)Primary Slave: NoneCurrently Active Slave: eth0MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upSpeed: 10000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 34:40:b5:be:e4:28Slave queue ID: 0Slave Interface: eth1MII Status: upSpeed: 10000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 34:40:b5:be:e4:2cSlave queue ID: 0Modes of Bonding:Mode 0 (balance rr) :Sets a round-robin policy for fault tolerance and load balancing.Mode 1 (activebackup) : Sets an active-backup policy for fault tolerance. Another bonded slave interface is only used if the active bonded slave interface fails.Mode 2 (balancexor) :Sets an XOR (exclusive-or) policy for fault tolerance and load balancing.Mode 3 (broadcast) : Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.Mode 4 (802.3ad) :Sets an IEEE 802.3ad dynamic link aggregation policy.Mode 5 (balance-tlb) : Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing.Mode 6 (balance-alb) : Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing.Parameters (etc)Security Logs:cat /etc/syslog.confcat /etc/logrotate.confcat /etc/audit/auditd.confMemory Parametes:cat /etc/sysctl.conf Parameters setting globally (/etc/system)sysctl p setting the parameters permanently by reading the kernel.sysctl a Listing the parameterscat /etc/security/limits.conf Parametrs setting userwise (/etc/projects)Tuning and maintaining the kernelUname a, uname mHow to upgradeCreate a local repo and startyum install kernelvi /etc/grub.confmodeprobe I fusemodeinfo fuseHow To set parametervi /etc/grub.confroot rd_NO_LUKSsysvctl=1rhgh quietAfter setting the parameter ,reboot the server .Cat /proc/cmdline It will list the parameterIP ForwardingVim /etc/sysctl.confnet.Ip4.IP_forward=0 change it to 1 :wq!sysctl p To loadLoop mounting# mount -o loop disk1.iso /mnt#mount /dev/cdrom /media Mounting CDROM or isoimages connected in vmwareChanging NIC interface from OS Level on basis of MAC ID Level[root@PMSTRA551 /]#cat /etc/udev/rules.d/70-persistent-net.rules# PCI device 0x8086:0x100e (e1000)#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="06:c7:ed:00:00:09", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x8086:0x100e (e1000)#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="06:64:cb:00:00:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"#PCI device 0x1af4:0x1000 (virtio-pci)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="06:f1:8e:00:00:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"Remove the # from required lines.User Administrationuseradd s /sbin/nologin tom To create a user with nologinuseradd d /mnt/joy To create a user with home directory mentionedusermod l nun oun To change the user nameusermod -u 700 un To modify the User IDusermod L username To lock the userusermod U username To unlock the usergroupadd To create new groupgroupdel To modify the groupgroups tom To show the groups for the usergroupmod n To rename the group nameusermod G sales sam To modify user groupsusermod G sales,mkt sam To add multiple groupsusermod G sales sam To append the groups without changing existingsgpasswd d sam sales To delete a user from a groupgpasswd a sam sales To append a user to the groupXstart Configutration:yum install xterm*yum install xorg-x11 Then try xclock command.Xmanager Setting in Linux[root@PTREXA751 gdm]# cat /etc/gdm/custom.conf# GDM configuration storage[daemon]RemoteGreeter=/usr/libexec/gdmgreeter[security]AllowRemoteRoot=true[xdmcp]Enable=true[greeter][chooser][debug]Execution Command in xstart window:/usr/X11R6/bin/xterm -ls -display $DISPLAYor/usr/bin/xterm -ls -display $DSIPLAYPerformance Monitoringecho 1 > /proc/sys/vm/drop_caches It will clear the cache memory and give us the space as freeps -auxf | sort -nr -k 3 | head -10 ==> Top 10 users consuming cpups -aux | sort -nr -k 4 | head -10 ==> Top 10 users consuming memoryfree mtopcat /proc/cpuinfo | grep physical id | sort | uniq | wc l To list the number of processorscat /proc/cpuinfo | grep cpu cores | uniq To list no: of cores#iostat -x 2 disk utilization details.O/P:Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %utilThe high disk utilization is typically observed when %util field in the iostat output reaches up to 90-100%STDIN STDOUT SDTERR Standard IOsDate > date.txt To redirect the output to defferentCal >> date.txt To append the listTr a-z A-Z index.html (WELCOME TO MY PAGE) this name should be sameService httpd status, restart Chkconfig httpd onLinks 192.168.0.250 To connect from clientElinks 192.168.0.250 From command promptCat /var/log/httpd/access-log To check http logsCat /var/log/httpd/error-log To check error logsAutomated installation/KickstartAutomated installation/Kickstart(in server the services DHCP,tftp it has to be enabled)*pxe should be enabled in the client machine for network boot==> enable from bio prompt---------------------------------------------------------------------------------------------------------------------------Kickstart server configurationYum install system-config-kickstartDesktops-desktop-xwindows system this package need to be enable to configure kickstart in server as graphic#system-config-kickstart To configure the kickstart server==> do it from graphicsBasic configuration-Language, root passwd, Timezone etc.Installation methord- FTP, HTTP, Harddrive FTP server=192.168.0.254, FTP Directory= pub/rhel6/dvdBoot loader, partition information ,Network configuration-Add networkdevice Network device=eth0, IP=DHCPAuthentication, Firewall configuration, Display,Package selection- Desktops-Desktop-windows desktopPreinstallation script, post installation script*update above details and File-save .*by default ks.cfg file will be created , copy the file to our location eg: /var/ftp/pub or /var/www/html/pub/kickstartORCreate ks.cfg file be mentioning below details.copy the iso image in /var/www/html/pub directory or ftp dir# cd /var/www/html/pub# ls -ltrdrwxr-xr-x. 12 root root 4096 Jul 3 2013 RHEL6.3drwxr-xr-x. 7 root root 4096 Sep 20 2013 CENT5.4drwxr-xr-x. 7 root root 4096 Sep 26 2013 CENT5-4drwxr-xr-x. 2 root root 4096 Sep 26 2013 cent5drwxr-xr-x 2 root root 4096 Nov 1 2013 cent5-5drwxr-xr-x 2 root root 4096 Jan 8 13:05 rheldrwxr-xr-x. 2 root root 4096 Jan 15 12:40 kickstart#cd kickstart*create the ks.cfg file on the location /var/ftp/pub or /var/www/html/pub/kickstart------------------------------------------------------------------------------------------------------------------------------From Client SideBoot from cd and select boot and typelinux ks=http://10.0.7.163:/pub/kickstart/ks.cfg append ip=10.0.8.92 netmask=255.255.255.0 gateway=10.0.8.1Ks=ftp://192.168.0.106/pub/ks.cfg To start the installation from the client machine (select standard . Then space and ks=ftp)Ks=http://server/ dir/file Ks=ftp://server/dir/fileKs=nfs:server:/dir/fileKs=hd:device:/dir/fileKs=cdrom:/dir/fileHardlink and sympolic linkLs i a.txt To check the inode numberLn /root/a.txt /a.txt To hard link a fileLn s file1 file2 To soft link a file from file1 to file2KDUMP ConfigurationPackagessystem-config-kdump-1.0.14-4.el5 / kdump-1.0.14-4.el5kexec-tools-1.102pre-77.el5cat /etc/grub.confkernel /vmlinuz-2.6.18-164.el5 ******* crashkernel=128M@16Mvi /etc/kdump.confpath /var/crashcore_collector makedumpfile -c --message-level 1cat /etc/sysctl.conf# Controls the System Request debugging functionality of the kernelkernel.sysrq = 1Restart the Service/etc/init.d/kdump restartfor panicking the OSAlt+SysRq+CUser Quotarepquota -a ==> Listing the quota details/etc/fsttab ==> after default,usrquota,gpquota on required mountpointremount the mounpoitquotacheck -cug /mounpoint ==> creating quotadbquotacheck -avug /mountpoint ==> enablingCreating quota for useredquota -u usernameSSH Trust Relation:Creating trust relationship b/w 26.38 to 30.100. ie taking ssh from 26.38 to 30.100 without asking passwd.For particular user, eg:billrp (billrp users should be there in both servers)--------------------------------------------------------From 26.38:#su - billrpCheck the home directory of billrp. If id_rsa.pub is in the /homedirectory/.ssh. Go to homedirectory/.ssh/. Exectute below command directly.#ssh-copy-id -i id_rsa.pub [email protected] id_rsa.pub is not there, follow below step#ssh-keygenGo to /homedirectory/.ssh#ssh-copy-id -i id_rsa.pub [email protected] AdministrationCreating Swap Spacefdisk cu /dev/vda create a normal partition and change the partition ID to 82 W to save , partprobe, rebootmkswap /dev/vda5 To format as swapswapon /dev/vda5 To activate swap spaceswapon s It will display the swapswapon aswapoff /dev/sdc1 Remove the swap spaceCreating swap filedd if=/dev/zero of=/swapfile bs=1M count=128 To create a swap using filecat swapfilemkswap /swapfileswapon swapfileswapon supdate in /etc/fstab to make permanent .swapon aswapoff /swapfile To remove the swap fileCreating SWAP by using 4gb slice.#fdisk /dev/sdcCommand (m for help): pCommand (m for help): npPartition number (1-4): 1Last cylinder, +cylinders or +size{K,M,G} (1-10240, default 10240): 4096Command (m for help): pCommand (m for help): tHex code (type L to list codes): 82Command (m for help): pCommand (m for help): wThe partition table has been altered!#partprobe#mkswap /dev/sdi1#swapon /dev/sdi1#swapon -s#free -g#vi /etc/fstabNFSServer Side:Create a directory and touch files eg: /newvi /etc/exports/new 192.168.0.0/255.255.255.0(ro,sycn,no_root_squash) exportfs a To export allShare Options:root_squash : nfs client root user cant modify files from client side. By default options is root_squashno_root_squash : nfs client root user can modify files from client sideClient Side:showmount emount t nfs 192.168.0.0:/new /testAutofs:#vi auto.master/demo /etc/auto.demo create this line below the /misc line.#cp -pr auto.misc auto.demo#vi auto.demopublic rw,intr,soft 10.15.1.5:/wipro make this entry in last lineservice autofs restart To restart the serviceorservice autofs stopservice autofs startcd /demo ls . No public will show but cd public it will work .CIFS - SambaSambaclient is the package nameSmbclient L 192.168.0.254 To list the shared from the serverSamba ServerSamba provides 4 main service1 authentication and authorization of users2 file and printer sharing3 name resolution4 Browsing*CIFS is the filesystem is used by sambaCIFS Common Internet FilesystemThree packages required for samba-(samba, samba-client,samba-common-samba) port-445/etc/samba/smb.conf This is the configuration file2 types of samba configuration public users and private users*samba_share_t This is the selinux contestHow to configure as public*Install 3 packages then edit the fileVi /etc/samba/smb.conf.WORKGROUP=fg.netThen go to last line[winshare]Path =/linuxPublic =yeshosts allow =192.168.0. 127Browsable =yes :wq!Service smb restartService chkconfig onClient SideSmbclient //192.168.0.250/winshare NIncase if it is not accessible, then check the selinux contest eg: ls lZd linux .change from default_t:s0 to samba-share_tChcon t samba_share_t /linuxLs lZd /linuxSmbclient //192.168.0.250/winshare NTo access from BrowserSmb://192.168.0.250/winshareHow to configure as private/validVi /etc/samba/smb.conf[winshare]Path /linuxValid users =tomHosts allow =192.168.0. 127.0Browseable =yes :wq!Smbpasswd a tom To add user to the sambaAnd set the password eg: 123Smbpasswd e tom To enableService smb restart10Chkconfig smb onClient SideSmbclient //192.168.0.250/winshare U tomMount o username=guest200 //192.168.0.254/ftp /remote/ To mount (provide the blank password)Cd /net This is the location all the NFS shares will be available .(cd 192.168.0.254)Chagechage m 0 M 90 W 7 I 14 student To change the user password settingschage l student To list the user informationchage E 0 student To expire the user nowchage E never student To remove expirychage d 0 student To change the password at next logonNetwork user account with LDAP (port/Code=389) LDAP is fast and securedCat /etc/services here it will display all the port numbersDc=example,dc=comYum groupinstall Directory-Client This package is required for LDAP client configuration system-config-authentication editing for LDAP clientUser Account Database LDAPLDAP search base- dc=example,dc=com7.LDAP server- instructor.example.comAuthentication methord LDAP password*Select use TLS to encryptDownload certificateCertificate URL: http://instructor.example.com/pub/EXAMPLE-CA-CERTOk and Apply*SSD is the daemon for LDAP clientGetent passwd ldapuser10 This the command to access the ldap user from the clientShowmount e 192.168.0.254 To see the remote NFS shared .How to set Home directory for ldapusers*/home/guests*is the home directory for ldap users (in the server)Vi /etc/auto.master (under misc) /home/guests /etc/auto.misc :wq!Vi /etc/auto.misc go to the last line, ldapuser11 -rw,soft,intr instructor.example.com:/home/guests/ldapuser11 :wq! (or Ip also can use)Service autofs reload To reload the autofs serviceSu ldapuser11 To switch to ldap userVi /etc/auto.misc (* -rw/soft,intr instructor.example.com:/home/guests/&) :wq! To set access for all usersMail ServerMTA Mail Transport Agent - MDA Mail Delivery Agent - MRA Mail Receiving Agent - MX Mail exchange Record*postfix is the package required for mail servervi /etc/postfix/main.cfinet_interface=localhost change it to allservice postfix restart& chkconfig postfix on#mail [email protected] mail [email protected] of mailsVim /etc/aliasGo to the last line and addroot: jack :wq!Newaliases To refresh or add new [email protected] u jackWeb ServerAppache webserverhttp hyper text terminal Protocolhttpd is the package/etc/httpd/conf/httpd.confHttpd_sys_content_t Selinux contexthttp- 80https -443IP based webhosting and Domain based web hostingYum install httpdVi /etc/httpd/conf/httpd.confCopy the last 7 lines and pastto the endEdit only 1, 3 4 7 lines edit and save1-Virtua host 192.168.0.250:80>Document Root /var/www/htmlServer Name demo.example.com# remove this # :wq!Httpd t To check the updated file has any mistakesCreate a file under /var/www/htmlCat >index.htmlService httpd statusService httpd restartChkconfig httpd onTo restrict the IP based hosting from others to accessEdit the same fileVi /etc/httpd/conf/httpd.conf:582 go to 582 line and copy 6 lines and past to the end and edit those lines

Allow from 192.168.0.250 :wq!How to break the root password*Reboot the system, while rebooting press e when shows Redhat..*select kernel.. e*Type 1 to boot as single user mode*b to boot the server*Then it will go to the single user mode .#passwd root To change the root passwordBooting to Rescue ModeBoot from CDType boot: linux rescuechroot /mnt/sysimagegrub-install /dev/sda Installing corrupted grub from rescue mode on the /boot device /dev/sdasudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT --to-ports 60021 Re-directing the port 21 to different port 60021VNCVnc packages : xterm, xorgSteps for starting vnc, execute the cmd: #vncserverDate and Time Changingdate +%Y%m%d -s "20140812"date +%T -s "12:06:13"#uname m = To check the architecture of osx86_64 ==> 64-bit kerneli686 ==> 32-bit kernelURL For downlaoding Wine Packagehttps://access.redhat.com/solutions/41579https://access.redhat.com/solutions/3358http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/wine.html