Powered By Blogger

Thursday, 27 June 2013

LVM

Logic Volume Manager
LVM is a software that allows Logical Partition Management. LVM is use for extend  and reduce size of the partition according to the requirement.
Physical Volume(PV)
Adding the new hardware for LVM is called Physical Volume.
Volume Group(VG)
Collection of physical volume is called Volume group.
Logical Volume(LV)
The space of volume group which is used for storing the data is called Logical Volume.

Implement of Logical Volume

#fdisk /dev/sda ( to create a new partition of 8e type)

Create Physical Volume
#pvcreate /dev/sda12 (sda12 is your new partition or new HDD)
#pvdisplay
Create Volume Group
#vgcreate kaushal /dev/sda12 (here kaushal is VG Name and /dev/sda12 is PV)
#vgcreate -S 16M kaushal /dev/sad12 (you can also create VG through this command. -s showing the size for VG 16m is the size for VG. kaushal is the name of VG)
#vgdisplay
#vgextend kaushal /dev/sda13 (to extend the size of VG)
#resize2fs -f /dev/kaushal/thakur
Create Logical Volume 
#lvcreate --size +1000M -n thakur kaushal ( here thakur is LV name and kaushal is VG name)
#lvdisplay
after that mount the volume
#mount /dev/kaushal/thakur /rhel (kaushal=VG, thakur=LV, Rhel=Mount Directory)
After that format the volume
#mkfs.ext3 /dev/kaushal/thakur

Extend The Size Of LV

#lvextend --size +1000M /dev/kaushal/thakur
#resize2fs -f /dev/kaushal/thakur

Remove LV, VG, PV

#lvremove lvname 
#vgremove vgname
#pvremove pvname

LV Reducing 

first of all unmount  the volume
#umount  /kaushal/thakur /rhel
#e2fsck -f /dev/kaushal/thakur
#regize2fs -f /dev/kaushal/thakur 500M
#lvreduse --size 500M /dev/kaushal/thakur 
#mount /dev/kaushal/thakur /rhel
Permanent Mount Of VG
#vim /etc/fstab
create here entry for your VG 



     

DHCP


Dynamic Host Configuration Protocol
DHCP is use for to provide the dynamic IP address and other network configuration such as getway address, DNS address  to host connected in the network.

                        Package = dhcp
                        Deamon = dhcpd
                        Port number = UDP 67 for dhcp server , 68 for dhcp clients
                        Configuration file = /etc/dhcp/dhcpd.conf

Configuration
                        # /etc/dhcp/dhcpd.conf
if you did not see any content in the file then copy all configuration content from the sample file. for this
                         # cp -p /usr/lib/dhcpd/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
edit /etc/dhcp/dhcpd.conf file
                         1) give here network address and subnet mask
                         2) give here server IP address NIS Domain, Domain and DNS domain name if you have.
                         3) after that give the range of IP you want to use in the network.
                         4) you can also reserve IP for future use
                         5) at last of file you can spicify the IP address for perticulre MAC address.
after that save and exit from the file and restart the DHCP service.
                          #service dhcpd restart 
On client 
 set automatically IP address under the LAN card property.
                           #dhclient ( for requesting the IP from server)



Monday, 24 June 2013

NTP

 NTP server is mainly use for time synchronization.
Area of NTP:-
                        1) crontab
                        2) backup script
                        3) remote based
                        4) Kerberos
                        5) CA
                        6) Time based all policy
In a one organization we can create maximum 3 NTP server.
For Example.
                       1) Stratum-10  1st server
                       2) Stratum-15 2nd Server
                       3) Stratum-16 3rd Server It on peer based

Service Profile

                  System V-managed service
                  Package             = ntp
                  Daemon             = ntpd
                  Configuration file = /etc/ntp.conf
                  Port number       = 123 (UDP)
                  Log file               = /var/log/message 

Configuration 


                  # vim /etc/ntp.conf
Uncomment here
                  Server 127.0.0.1
                  Fudge 127.0.0.0 stratum 10
After that save the file and restart service 
                  # service ntpd restart

On clients

                  # system-config-date
and make configuration here add the IP of server after that restart the service 
                  # service ntpd restart

On CLI based

   Option 1:-
                  # ntpdate –b ip of ntp server
Option 2:-
                  # vim /etc/ntp.conf
insert here
                 Server ip of server (Ex. Server 172.17.1.1)

Monitering of NTP

                  #ntpq
                  Ntpq> host ip of ntp server (Ex host 172.17.1.1)
                  Ntpq> peers
                  #ntpq –p

Syslog server

Syslog server is use for store centralized logs of all running server machine.
It is also called centralized syslog server.
We can create one or more syslog server in a one network.

              Package               = rsyslog
              Daemon                = rsyslog
              Configuration file   = /etc/rsyslog.conf
              Port number          =514

Configuration 

             #vim /etc/rsyslog.conf
 Uncomment here these line 
            UDP syslog reception
            TCP syslog reception 
After that save the file


On clients

           Cron.* @ip of syslog server
           Mail.* @ip of syslog server
           *.* @ IP of syslog server ( for all service logs )
           Authprev.* @ ip of syslog server

Telnet

Telnet service is use for remote logging from one host to another host.
Data always transfer into plain format.

    Port number            = 23
    Package                  = telnet-server, telnet
    Configuration File    = /etc/xinetd.d/telnet
    Log file                    = /var/log/secure 

Installation  and configuration 

               #yum install telnet* -y
               # vim /etc/xinetd.d/telnet
In this file edit this-
               Disable = no
after that save the file and restart the service 
              # service xinetd restart

Note:- Telnet service is not enable for root user by defaults.

Telnet User Monitoring tool

                      # who
                #w
                #pinky
                #tail –f /var/log/secure 

On client Side  :-

              # telnet ip of telnet server (Ex. telnet 172.17.1.1)

To allow root user for telnet

              # vim /etc/pam.d/remote
Comment here this line
              # Auth    required  pam_securitty.so
after that save this file.

Check the session process of Telnet user

                    # who –u 

Rules allow/deny for  telnet user

              # vim /etc/xinetd.d/telnet
Insert here rules 
            No_access = IP Address
            Example= 172.17. {5,6,7,8} .example.com 172.17.1.1/16
            Only_from = IP address
            Access_time =give here time (Example10:00-12:00 18:00-20:00)
            Log_type = FILE give here location (example /var/log/kaushal)
            Log_on_sucess +=USERID PID DURATION HOST
            Per_source  = give here host value 

For more option:-
              #man xinetd.conf


Xinetd Services
Extended Internet Daemon 
Xinetd is a standard deamon which is maintain these number of remote services.                                           
                                                                                                                                                                                                                                                                                                                                                                                                          
                                                 1)     Telnet
                            2)   rlogin
                            3)   klogin
                            4)   tftp
                             5)   sync

All configuration files store into /etc/xinetd.d directory.
         Ex:- /etc/xinetd/telnet


In case of all these services we will start only single services 
            
               # Service xinetd restart
               # chkconfig xinetd on