Showing posts with label MithunTechnologies. Show all posts
Showing posts with label MithunTechnologies. Show all posts

Saturday, February 22, 2020

Steps to create password less ssh between two AWS EC2 instances - Mithun Technologues - +91-9980923226

Steps to create password less ssh between two AWS EC2 instances - Mithun Technologies - 9980923226

Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com

                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
Steps to create password less ssh between two AWS EC2 instances

Pre Requisites

  2 Linux Servers
     Redhat Linux Server - A
     IP:       13.233.128.180
     User:     ec2-user
     Password: ********
   
     Redhat Linux Server - B
     IP:       13.127.64.6
     User:     ec2-user
     Password: ********

Step  1

Generate the ssh key using below command in Redhat Linux Server - A

ssh-keygey
~/.ssh/
id_rsa
id_rsa.pub

Step 2
Copy the public key from Redhat Linux Server - A to Redhat Linux Server - B as follows.

ssh-copy-id ec-user@Redhat Linux Server - B HostName/IP Address


Step 3
Test the configurations as follows.

ssh ec2-user@Redhat Linux Server - B HostName/IP Address

It should not ask the password and It will successfully connected to Redhat Linux Server - B from Redhat Linux Server - A




  

Thursday, October 17, 2019

Install Maven Build Tool in MAC - Mithun Technologies - +919980923226


             Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com
                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 

Install Maven Build Tool in MAC Book / Set Class path for Maven Build Tool in MAC Book
---------------------------------------------------------------------------------------------------------------------

Pre Requisite Software
-----------------------------
Java is the Pre Requisite Software for Maven.

java -version


Install Maven
------------------

Download the Maven Software using below url.
https://maven.apache.org/download.cgi

Set the class path/Environmental Variable
vi ~/.bash_profile

export M2_HOME=/Users/mithunreddy/MithunTechnologies/Softwares/Running/apache-maven-3.6.2

export PATH=$PATH:$M2_HOME/bin

source ~/.bash_profile

Check the Maven version

mvn -version

Monday, September 16, 2019

Install Ansible in AWS EC2 Redhat Server - Mithun Technologoes +91-9980923226

 

 
  Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com
                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
Ansible Installation

1) Create RedHat 3 Servers (1-AnsibleServer , 2- Host Machines for demo) in AWS.
 

2) Login As a root user and create ansible user and provide sudo access in all Servers.

    2.1) Create the user ansible and set the password on all hosts:
           sudo useradd ansible
           sudo passwd ansible
     
    2.2) Make the necessary entry in sudoers file /etc/sudoersfor ansible        
           user for password-less sudo access:
          
           visudo

           ansible ALL=(ALL) NOPASSWD: ALL

       

    2.3) Make the necessary changes  in sshd_config file /etc/ssh/sshd_config    
           to enable password based authentication.

         Un comment PasswordAuthentication yes
         and comment  PasswordAuthentication no.
         And save the file .

            vi /etc/ssh/sshd_config

     2.4)    Then restart sshd service.
                sudo service sshd restart

=============================================================================
               Install Ansible in Red hat (Ansible Server)
=============================================================================

1)     SSH to Redhat System & Switch to ansible user
       sudo su - ansible
      
2)     Install python
       sudo yum install python3 -y
      
3)    Update python alaternatives
       sudo alternatives --set python /usr/bin/python3
      
4)    Verify Python Version
         python --version
 
5)    Install ansible using Yum 
sudo yum -y install ansible
      
6)    Verify Ansible version
       ansible --version
       
=============================================================================
               Generate SSH Key, Copy SSH Key(Ansible Server)
=============================================================================

1)    Now generate SSH key in Ansible Server

sudo su - ansible

ssh-keygen

2)    Copy it to Host  servers as ansible user: 

  Repeat below command by updating HOST IP for all the  HOST Servers. 

          ssh-copy-id ansible@<HostIP>

 

Update Host Inventory in Ansible Server to add host servers’ details.

1)    Add Host Server details

 

vi  /etc/ansible/hosts

 

# Connect using username and password

192.168.1.105 ansible_user=ansible ansible_password=password

 

# Connect using username and pem(Make Sure Have pem file at given path)

172.31.35.23 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws.pem

 

# If ssh keys are copied

172.31.35.23

 

2)    Use ping module to test Ansible and after successful run you can see the below output. 

 

          ansible all -m ping

            172.31.35.23 | SUCCESS => {

            "changed": false,

             "ping": "pong"

             }

 

3)    Install sshpass in Ansible server if you get below error .

 

"to use the 'ssh' connection type with passwords, you must install the sshpass program

$ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/sshpass-1.06-2.el7.x86_64.rpm

Tuesday, August 27, 2019

Linux Commands - Mithun Technologies - 9980923226



             Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com
                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
                                                       Important Linux Commands

mkdir: Make or Create directory

find : find command used to search and locate list of files and directories based on conditions you specify for files that match the arguments. Find can be used in variety of conditions like you can find files by permissions, users, groups, file type, date, size and other possible criteria.

umask :  User Mask or User file creation MASK : It is used to set the permissions for files/directories  newly created on a Linux Machine.

chmod : It will change the file or directory access permissions.

chown: It will change the ownership of the file a file.

chgrp: It will changes the group ownership of a file or directory.

cp :   It will copy file contents of one file to another file.

mv: It will move or rename the file.

wc: Counts the number of lines, words, bytes, or characters in a file.

ln :  It will create the link between files.

vi or vim: Text editor.

tail : It will display the last 10 rows.

scp :

grep: which stands for "global regular expression print," processes text line by line and prints any lines which match a specified pattern.

who :  Displays the current users working on the system.

w : Show who is logged on and what they are doing.

df : Report file system disk space usage

ifconfig: To find the IP address.

man : Display the on-line manual pages.

service : It will give the status of service.

uptime: Tells how long the system has been running.

last: show listing of last logged in users.  

ps : Display the current process running.

kill : Kill the process.

top : Display Linux tasks. 


   





Ansible Installation in Amazon Linux - Mithun Technologies - 9980923226

  Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com                                                 ...