Saturday, October 4, 2014

                                         


After changing the IP address of a server, at the time of booting up sendmail and sm-client took a very long time (about 4 minutes each) to start. Usually when sendmail is sluggish starting - it's because it can't figure out hostname details.

# cat /etc/hosts

127.0.0.1  localhost.localdomain localhost

above needs to be the very first line of /etc/hosts

if you are accepting email for a domain then it would help if you have

the fully qualified domain name set in /etc/sysconfig/network and that

name resolves via dns or at least is listed with an ip address

in /etc/hosts...

i.e.

# hostname

linuxserver.mydomain.com


 # cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=linuxserver.mydomain.com


 # cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

192.168.1.2 linuxserver.mydomain.com linuxserver

# host linuxserver.mydomain.com

linuxserver.mydomain.com has address 192.168.1.2


# cat /etc/mail/local-host-names

mydomain.com

linuxserver.mydomain.com

www.mydomain.com

localhost

localhost.localdomain



           IP forwarding also known as Internet routing is a process used to determine which path a packet or datagram can be sent. The process uses routing information to make decisions and is designed to send a packet over multiple networks.
                     Defaultly any UNIX/Linux distributions will have IP Forwarding is disabled.  As most of the peoples will not need IP Forwarding, but if we are setting up a Linux router/gateway, when you want your system to act as VPN server, and for sharing the internet connection. See the below steps for enable or disable IP forwarding in linux.

Step1: Check the IP forwarding is enable or disable
   

               In this step we have to check the IP forwarding using sysctl command
 [root@bsrtech ~]# sysctl net.ipv4.ip_forward
 
  Sample Output:
  

             net.ipv4.ip_forward = 0

Step2: To Enable IP Forwarding Temporarily
    
     To enable IP Forwarding temporarily,you can use any of the following commands

   [root@bsrtech ~]# echo 1 > /proc/sys/net/ipv4/ip_forward

     (or)
   
   [root@bsrtech ~]# sysctl -w net.ipv4.ip_forward=1 

  To check the IP Forwarding is enabled or not , execute the following command

   [root@bsrtech ~]# sysctl net.ipv4.ip_forward

Step3: To Enable IP Forwarding Permanently
  To enable IP forwarding permanently, you can change value in configuration file /etc/sysctl.conf

  [root@bsrtech ~]# vim /etc/sysctl.conf

   you can find the line "net.ipv4.ip_forward" and Set net.ipv4.ip_forward to 1
  
      

    net.ipv4.ip_forward = 0
    
    to

    net.ipv4.ip_forward = 1

  :wq (Save and close the file)
                                                          

Step4:  Reload the changes 
  To load the settings that we made to /etc/sysctl.conf file, run the following command

 [root@bsrtech ~]# sysctl -p

  Sample Output:

                                   


 Step5: To Disable IP forwarding Permanently

     you can find the line in /etc/sysctl.conf "net.ipv4.ip_forward" and Set net.ipv4.ip_forward to 0 

    net.ipv4.ip_forward = 1
    
    to

    net.ipv4.ip_forward = 0
  
   :wq (save and close the file)
 
  Reload the changes using sysctl command

  [root@bsrtech ~]# sysctl -p

  Sample Output:

                                         

ssh

                             

Linux Administrators  normally login to the linux servers either 
supplying a password, or using keybased authentication. sshpass 
command is a tool which allows us to automatically supply 
password to the command prompt so that automated scripts can 
be run as desired by users.




Features of sshpass :

 1.Taking backups to a remote server
 2.Executing commands on systems at a specified time.

Step1:
Setup the RPMforge  (or)  EPEL repository

Then run root 

   #yum install sshpass -y

Getting Help :

  #sshpass -h

Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
   -f filename      Take password to use from file
   -d number       Use number as file descriptor for getting password
   -p password    Provide password as argument (security unwise)
   -e                    Password is passed as env-var "SSHPASS"
  

 With no parameters - password will be taken from stdin

   -h                 Show help (this screen)
   -V                Print version information
At most one of -f, -d, -p or -e should be used

How to use sshpass command:
Login to ssh server called server.example.com with password called trDR34@r%$#:

$ sshpass -p 'trDR34@r%$#' ssh username@server.example.com

How to backup data using sshpass:

$ sshpass -p 'password' scp  -r  username@server.example.com:/var/www/*   /backupdata

(where backup data from remote server to local server)

Tuesday, September 2, 2014

                             

Linux Administrators  normally login to the linux servers either supplying a password, or using keybased authentication. sshpass command is a tool which allows us to automatically supply password to the command prompt so that automated scripts can be run as desired by users.




Features of sshpass :

 1.Taking backups to a remote server 
 2.Executing commands on systems at a specified time.

Step1:
Setup the RPMforge  (or)  EPEL repository

Then run root 

   #yum install sshpass -y

Getting Help :

  #sshpass -h

Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
   -f filename      Take password to use from file
   -d number       Use number as file descriptor for getting password
   -p password    Provide password as argument (security unwise)
   -e                    Password is passed as env-var "SSHPASS"
  

 With no parameters - password will be taken from stdin

   -h                 Show help (this screen)
   -V                Print version information
At most one of -f, -d, -p or -e should be used

How to use sshpass command:
Login to ssh server called server.example.com with password called trDR34@r%$#:

$ sshpass -p 'trDR34@r%$#' ssh username@server.example.com

Backup:-

                 
                 Data Backup is the physical copying of data files to a removable  storage device that allows the data to be stored in another location.  When needed, an individual data file or an entire set of data files,  can be restored to a computer system.


USERS OF  BACKUP & RECOVERY:

    1)To copy data to alternate media 
    2)To prevent data loss 
     
     Note: Only administrators can backup the data

Types of data:

      I)System generated data
      II)User generated data

Types of backup:
      1)Full backup
      2)Incremental backup
      3)Differential backup

 1)Full backup :   complete backup of entire system

2)Incremental backup:  It includes all files that were changed since last backup. It always smaller than differential backup.



3)Differential backup:  It includes all the files that were changed since last full backup. As time increases since the last full backup the size of differential backup increases.



Commands for backup:

     1)tar (tape archieve)
     2)cpio (copy input/output)
     3)dump

1) tar:

#tar <options> <destination> <source>
Note:destination must be in .tar extension
options:
-c=create
-v=verbose
-f=file
-t=table of content
-x=extract to
-w=interactive
-z=zip

To take backup

#tar -cvf <path> <file name> <source>
ex:tar -cvf passwd.tar /etc/passwd 

To list the content of tar file
#tar -tvf <path> <file name>
ex:tar -tvf passwd.tar 

To extract content of file

#tar -xvf <path> <file name>
ex:tar -xvf passwd.tar

To take backup along with zip

#tar -cvzf <path> <file name>

Note:file name must be with an extension of .tar.gz

example 
 
#tar -cvzf passwd.tar.gz /etc/passwd

To extract zip file

#tar -xvzf <path> <file name>
example :
 #tar -xvzf passwd.tar.gz

2) cpio(copy input/output):

Backup using cpio:

#ls <options> | cpio -ov > <file name>
example:ls -l | cpio -ov > sun

To extract:

#cpio -iv <file name>
example:cpio -iv sun

3) dump  : 

Backup using dump:
#dump -Ouf <device> <file name>
example:dump -Ouf /media/<pendrive> sun
To extract:
#restore -f <path>
example:restore -f sun

Remote backup:

#rsync -avz <source> -e ssh <destination IP>:<directory>
example:rsync -avz mahesh -e ssh 192.168.1.20:/root/mahesh

#scp -r <source> <destination IP>:<directory>
example:scp -r mahesh  192.168.1.20:/root/mahesh

                                                                          

                                                              
After changing the IP address of a server, at the time of booting up sendmail and sm-client took a very long time (about 4 minutes each) to start.

Usually when sendmail is sluggish starting - it's because it can't figure out hostname details.
# cat /etc/hosts

127.0.0.1  localhost.localdomain localhost


 above needs to be the very first line of /etc/hosts

if you are accepting email for a domain then it would help if you have

the fully qualified domain name set in /etc/sysconfig/network and that

name resolves via dns or at least is listed with an ip address

in /etc/hosts...

i.e.
# hostname

linuxserver.mydomain.com

 # cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=linuxserver.mydomain.com


 # cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

192.168.1.2 linuxserver.mydomain.com linuxserver
# host linuxserver.mydomain.com

linuxserver.mydomain.com has address 192.168.1.2


# cat /etc/mail/local-host-names

mydomain.com

linuxserver.mydomain.com

www.mydomain.com

localhost

localhost.localdomain

Monday, June 16, 2014


ognizant  is a leading provider of information technology, consulting, and business process outsourcing services, dedicated to helping the world's leading companies build stronger businesses. Headquartered in Teaneck, New Jersey (U.S.), Cognizant combines a passion for client satisfaction, technology innovation, deep industry and business process expertise.
 


Company        :  Cognizant(CTS)

Website          :   www.cognizant.com

Eligibility        :    B.E/B.Tech/B.Sc/Others

Experience     :  0-4 Years

Location         :  Across India

Job Role        :   Associate - Projects


Job Description:

1. As a Project Associate, the candidate should involved in coding, testing, debugging.

2. Should be responsible for delivery of assigned work, under a module lead or team lead supervision.

3. Needs to understand technology and quality processes within Cognizant.


Candidate Profile:

1. The candidate should have completed Bachelor’s degree in Engineering or Science graduates from any reputed institution with 0-4 years of experience.

2. Should have excellent verbal and written communication skills.

3. Should have the working knowledge of the technical platforms of the project.

4. Should have the ability of applying design specifications techniques under supervision of the module leader / Project Lead.