Tuesday, September 23, 2014

Linux Engineer with 1-2 Year Experience Resume



                                                                                       RESUME

PravinKumar S                                                                            
Email - pravin0931@gmail.com
Mobile: +91 9791017362
                                                     

OBJECTIVE

To learn and function effectively in an organization and be able to deliver to the bottom-line. To constantly upgrade my knowledge and skills and make a difference in whatever I do.

 TECHNICAL SKILL 

 Operating System           :  RHEL (5, 6), Ubuntu12.04, CentOs, Windows 2003/2008 server.
Security                            :  SSH, SSL, CSF, IPTABLES
Protocols                          :  TCP/IP, NFS, SMB, DHCP, SSH, HTTP, VSFTP, DNS, SSH, SMTP, POP3, IMAP.
Database                           :  Mysql    
Web/App Servers            : Apache, Nginx, IIS
Monitoring Tool              : Nagios, Nmap, Top
Firewall                               : Sonic firewall 2400
Backup                               : Tar, Zip, Scp, Rsync, Dump
Package Management     : RPM, YUM Server, Third party packages like EPEL, pmforge.
Mail                                     : Sendmail, Exim and Postfix.

Global Certification:

RHCE (Red Hat Certified Engineer) in 2014
ID: 140-000-753
RHCSA (Red Hat Certified Server Administrator) in 2014
ID: 140-000-753

Roles and Responsibilities:
§  The primary responsibility is to carry out day-to-day tasks of System Administration and Monitoring and updating Tickets (issues) through Incident management system.
§  Different types of Installation and configuration on RedHat, CentOs, Ubuntu, and Windows7.
§  Configuring and Maintaining Microsoft Outlook 2003/2007, Thunderbird, outlook Express.
§  Administrations of Users and Groups.
§  Using NAGIOS Monitoring Linux servers such as Disk space utilization, CPU utilization, Memory utilization.
§  Linux Package management tools (rpm, yum etc)
§  Scheduling jobs using Crontab.
§  Maintaining Virus free Network using Symantec
§  Troubleshooting and Configuration of SSH, FTP, NFS and APACHE Server.
  • Database Knowledge with MYSQL with database optimization, backup and recovery.
  • Apache web server maintenance, installation, configuration, managing staging web hosting including name-based, secure and private site, certificate generate, manage user accounts.
§  Taking backup on Linux server using Rsync, Zip and Tar.
§  Handling Sonic Firewall 2400.
§  Setting up of SVN Repository server and maintaining repository for all projects.
§  Good knowledge in Cpanel, WHM and Plesk.
§  Maintaining Exim mail server.
§  Installing and configuring new servers based on requirements.
§  Maintaining IIS services and creating websites.

Client Projects:

§  Domain transfer to new domain provider.
§  Lsync file mirroring.
§  Knowledge in database mirroring master to master configuration.
§  Handling Rackspace, Amazon server EC2 instants and Hosting.
§  Mailgun, Smtp Auth, Sendmail and Exim mail server.
§  Site Migration to new server with updated configuration.
§  Svn Migration to new server and access control of svn user.
§  SSl implementation on servers.
§  PCI scan for vulnerability check.
§  Creating ftp user and lock them in particular folder.

EDUCATION QUALIFICATION

            B.E. Degree in Electronic and Communication, 2010.
            Bhajarang College of Engineering, Anna University.

PERSONAL INFORMATIONS

§  Name                            :  Pravin kumar. S
§  Date of Birth                :   09.06.1989
§  Gender                          :   Male 
§  Marital Status               :   Single
§  Languages                     :   Tamil, English
§  Permanent address        :   No.9, Sivasakthi Nagar, 9th cross Street, Chennai-109.

DECLARATION

     I do here by declare that the particulars of information and facts stated here in above are true, correct and complete to the best of my knowledge and belief.


PLACE:                                                                                                                                                 PRAVINKUMAR S
DATE:                                                                             

Friday, September 12, 2014

Automatic Mysql Databases Backup using Shell Scripting

In this post we will see how we are going to take mysql databases backup using simple shell scripting with help of crontab.

root@linuxstorages:~# vi Mysql_backup_script.sh

#!/bin/bash

# Parent backup directory
backup_dir="/var/backups/mysql"

# MySQL settings
mysql_user="root"
mysql_password=""

# Create backup directory and set permissions
backup_date=`date +%Y_%m_%d`
backup_dir="${backup_dir}/${backup_date}"
echo "Backup directory: ${backup_dir}"
mkdir -p "${backup_dir}"
chmod 700 "${backup_dir}"

# Get MySQL databases
mysql_databases=`echo 'show databases' | mysql --user=${mysql_user} --password=${mysql_password} -B | sed /^Database$/d`

# Backup and compress each database
for database in $mysql_databases
do
  if [ "${database}" == "information_schema" ] || [ "${database}" == "performance_schema" ]; then
        additional_mysqldump_params="--skip-lock-tables"
  else
        additional_mysqldump_params=""
  fi
  echo "Creating backup of \"${database}\" database"
  mysqldump ${additional_mysqldump_params} --user=${mysql_user} --password=${mysql_password} ${database} | gzip > "${backup_dir}/${database}.gz"
  chmod 600 "${backup_dir}/${database}.gz"

done

Change the permission for the script file to execute it.

root@linuxstorages:~#chmod +x Mysql_backup_script.sh
After changing the permission check the script is working properly by executing it in command prompt.

root@linuxstorages:~# ./Mysql_backup_script.sh
Now create a schedule timing for the script to execute and take the databases backup. This cron will run daily at 10 pm.

root@linuxstorages:~#crontab -e

* 22 * * *  /bin/Mysql_backup_script.sh

Sunday, September 7, 2014

Find the Database Creation date in Mysql

 To find the database creation date in MYSQL simply follow the below steps :


First enter into the mysql database.

root@linuxstorages:~#mysql -u root -p
Enter Password:

 DATABASE with all it TABLES

By executing the below command its shows the database and all tables creation date.

SYNTAX

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DATABASE NAME';

EXAMPLE

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'test';
+---------------------+
| create_time         |
+---------------------+
| 2014-08-22 13:06:47 |
+---------------------+
1 row in set (0.14 sec)

DATABASE with particular TABLE

By executing the below command we can able to see a single table creation date in a database.

SYNTAX

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DB_NAME' AND table_name = 'TABLE_NAME'

EXAMPLE

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'test123' AND table_name = 'widget';
+---------------------+
| create_time         |
+---------------------+
| 2013-11-19 18:52:32 |
+---------------------+
1 row in set (0.23 sec)
 

Monday, September 1, 2014

Mysqldump commands for Backup & Restore Mysql Databases

Mysqldump used to dump a database or a collection of databases for backup or transfer to
another SQL server (not necessarily a MySQL server). The dump typically contains SQL
statements to create the table, populate it, or both.  




Mysqldump can create a copy of current databases which will act as backup. It is very
important to take a backup of mysql databases,to face situation such as
corrupted database , data lose, server failure etc.

Syntax

root@linuxstorages:~# mysqldump -u [username] -p[password] -h [Remote Server] databasename > /path/backup_database.sql

U - Mysql Database user name

P - Mysql Database user password

H - Remote Server

Databasename - database name available in Mysql database


In three way we can use mysqldump commands to backup database

Mysqldump for single database :

root@linuxstorages:~#mysqldump -u root -ppassword123 linuxstorages >
/backup/linuxstorages.sql

Mysqldump for Multiple databases :

root@linuxstorages:~# mysqldump -u root -ppassword123 --databases testdb1 testdb2 > /backup/testdb1-testdb2.sql

Mysqldump for All databases :

root@linuxstorages:~# mysqldump -u root -ppassword123 --all-databases > /backup/all-databases.sql

Mysqldump on Remote Server :

root@linuxstorages:~# mysqldump -u root -ppassword@123 -h 10.5.1.3 linuxstorages > /backup/linuxstorages.sql

Mysqldump table in database :

Single Table:

root@linuxstorages:~# mysqldump -u root -ppassword123 [databasename] [tablename] > /backup/single-table.sql

Multiple Tables:

root@linuxstorages:~# mysqldump -u root -ppassword123 databasename table-1 table-2 table-3 > /backup/Multiple-table.sql

Use mysqldump --help for multiple option which can be used.

root@linuxstorages:~# mysqldump --help

Restore Mysql Database

Syntax:

root@linuxstorages:~# mysql -u [username] -p[password] databasename < /path/backup_database.sql

First create a empty new database

root@linuxstorages:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 454941
Server version: 5.5.31-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>show databases;

mysql>create database linuxstorages;
Query OK, 1 row affected (0.03 sec)   

exit

Now import the backup .sql file

root@linuxstorages:~# mysql -u root -p password linuxstorages < /path/linuxstorages.sql


Other best way to import database is

root@linuxstorages:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 454941
Server version: 5.5.31-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>show databases;



mysql>use linuxstorages;
Database changed

mysql>source /path/linuxstorages.sql;

Wednesday, August 27, 2014

Jailing Ftp user in VSFTP - locking user in their home directory

In this post we going to see about how we are going to jail a ftp user in VSFTP.  Jailing means that user is locked to their home directory, can't able view or access any other folder in that server.

Jailing is mainly done for security purpose. If the user is not jailed, so they can able to access all other folder and files, can download the main configuration files in that server which is not secured one.





First install VSFTP package in server.

[root@linuxstorages~ #] yum install vsftpd

[root@linuxstorages~ #] chkconfig vsftpd on


Create a user with directory which you need to jail.


[root@linuxstorages~ #] useradd -d /var/www/html username

[root@linuxstorages~ #] passwd username

Now change the configuration for VSFTP

  [root@linuxstorages~ #] vi /etc/vsftpd/vsftpd.conf

     Go to line 96 and enable the below line

     chroot_local_user=YES

     :wq (save)



[root@linuxstorages~ #] /etc/init.d/vsftpd restart

Now check by login via filezilla or terminal using 21 port.

Monday, August 25, 2014

Connecting SSH without Password in Linux



Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers. It connects, via a secure channel over an insecure network, a server and a client running SSH server and SSH client programs, respectively


But we connect a system via SSH it will ask for password each time when we try to connect it. When we are running a script which need to connect a server via SSH port it will ask for password but we can enter it so to avoid this we are creating as pass-wordless login between the servers which helps to runs the script without any issue.


Create Authentication SSH-Kegen Keys on current machine

While we creating Authentication SSH_Keygen it will ask for path to store the file and pass phrase password the login. Don't enter any password in pass phrase just hit enter.

[root@linuxstorages ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): [Hit Enter]
Enter passphrase (empty for no passphrase): [Hit Enter]
Enter same passphrase again: [Hit Enter]
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
36:47:58:f2:03:ab:be:71:bd:99:c5:3f:87:56:13:27 root@localhost.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
|        o .      |
|         B       |
|        o +      |
|       . . .  E..|
|      . S .    .o|
|     . . + .   ..|
|      o . . o  o.|
|       +   = .+ .|
|      .   +  ..o |
+-----------------+

By default it will go for RSA 2048 bit encryption if you feel need more strong encryption then can go for RSA 4096 bit encryption.

[root@linuxstorages ~]$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): [Hit Enter]
Enter passphrase (empty for no passphrase): [Hit Enter]
Enter same passphrase again: [Hit Enter]
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
6c:c6:ac:12:5d:db:bb:88:12:ab:bf:a7:8e:e4:76:eb root@localhost.localdomain
The key's randomart image is:
+--[ RSA 4096]----+
|                 |
|                 |
|        .        |
|     . = o       |
|    . . S .      |
|    .. +   .     |
|  . .o.   .      |
| o..+... . .     |
| .+*E*. . .      |
+-----------------+

Move the public key to remote machine to make connection between machine.

[root@linuxstorages ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.200
The authenticity of host '192.168.1.200 (192.168.1.200' can't be established.
RSA key fingerprint is 59:0a:a0:7f:e2:cc:00:b8:19:fa:4e:4b:0c:72:5a:c0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.200' (RSA) to the list of known hosts.
root@192.168.1.200's password:
Now try logging into the machine, with "ssh 'root@192.168.1.200'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

You have new mail in /var/spool/mail/root

Login to remote host machine without password now and further.

[root@linuxstorages ~]$ ssh root@192.168.1.200
Last login: Sat Aug 23 15:09:48 2014 from 192.168.1.100

Check the machine ip address after login

[root@linuxstorages_1 ~]$ ifconfig
eth1      Link encap:Ethernet  HWaddr 38:60:77:9B:FA:16
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::3a60:77ff:fe9b:fa16/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4331151 errors:5 dropped:0 overruns:0 frame:3
          TX packets:2907478 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:433288023 (413.2 MiB)  TX bytes:661916311 (631.2 MiB)
          Interrupt:20 Memory:fe400000-fe420000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:538498 errors:0 dropped:0 overruns:0 frame:0
          TX packets:538498 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:67721587 (64.5 MiB)  TX bytes:67721587 (64.5 MiB)

Saturday, August 23, 2014

Monitoring Windows Host Status from Nagios server

To monitor the windows machine from the nagios server we need first install the NSclient++ on windows machine host.

To download the NSclient++ in your windows machine use the below link

Link : http://nsclient.org/nscp/downloads

After downloading finished try to install the package in windows host




















We need change the configuration in NSclient++

Edit following file

C:\Program Files\NSClient++\NSC.ini


Enable following service which need to monitor

;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
;CheckHelpers.dll
;CheckWMI.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll
; NSCA Agent is a new beta module use with care!
;NSCAAgent.dll
; LUA script module used to write your own "check deamon" (sort of) early beta.
;LUAScript.dll
; Script to check external scripts and/or internal aliases, early beta.
;CheckExternalScripts.dll
; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
;NRPEClient.dll

Enter the Nagios server IP address in allow host line and enable it.

[NSClient]
;# ALLOWED HOST ADDRESSES
;  This is a comma-delimited list of IP address of hosts that are allowed to talk to

NSClient deamon.
;  If you leave this blank the global version will be used instead.
allowed_hosts= 192.168.1.202
;

Enable port for NSclient++ in windows machine.

;# NSCLIENT PORT NUMBER
;  This is the port the NSClientListener.dll will listen to.
port=12489
;

After changing configuration, start the NSclient service.

path : start --> administrative tools ---> services ---> NSclientpp(nagios)


If your firewall in enable in windows machine then add the nsclient port 12489 in firewall which allow you to access the nagios server.


Switch back to Nagios  Server

Add the check_nt command in the commands.cfg configuration file.

[root@linuxstorages~ ]# vi /etc/nagios/objects/commands.cfg

Add in last line of file

# 'check_nt' command definition
define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
        }
:wq (save)


Edit the nagios configuration file nagios.cfg to enable the window configuration.

[root@linuxstorages~ ]# vi /etc/nagios/nagios.cfg

Line no 39 enable windows.cfg file

# Definitions for monitoring a Windows machine
cfg_file=/etc/nagios/objects/windows.cfg

:wq (save)

Add the window remote host configuration in windows.cfg file and you can add multiple windows host machine in this file, no need create separate file for each windows host machine.

[root@linuxstorages~ ]#vi /etc/nagios/objects/windows.cfg


define host{
        use             windows-server  ; Inherit default values from a template
        host_name       winserver-2     ; The name we're giving to this host
        alias           My Windows Server       ; A longer name associated with the host
        address         192.168.1.200     ; IP address of the hos

        }

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        }

# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     Uptime
        check_command           check_nt!UPTIME
        }

# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }

# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     Memory Usage
        check_command           check_nt!MEMUSE!-w 80 -c 90
        }

# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }

# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     W3SVC
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
        }

# Create a service for monitoring the Explorer.exe process
# Change the host_name to match the name of the host you defined above

define service{
        use                     generic-service
        host_name               winserver-2
        service_description     Explorer
        check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
        }


After adding the windows host information restart the Nagios server.

[root@linuxstorages~ ]# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.

Check the Window host machine status in admin URL








 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism