Monday, January 9, 2017

Password Less SSH OR SSH login without Password in Hadoop Cluster


Secure SHELL (SSH) is an open source network protocol that is used to login into remote servers for execution of commands and programs.It is also used to transfer files from one computer to another computer over the network using secure copy (SCP) Protocol.

Here is the process to setup password-less login on any linux RHEL/CentOS using ssh keys to connect to remote Linux servers without entering password. Using Password-less login with SSH keys will increase the trust between two Linux servers for easy file synchronization or transfer.

In this example I will setup SSH password-less automatic login from server1 cloudglee.com (192.237.172.243) to cloudglee.com_2 (104.237.172.243).

Step 1) Go to ~/.ssh directory, please create ~/.ssh directory if already doesn't exist










Step 2) Login into server cloudglee.com (1st server) with root user and generate a pair of public keys using following command.
















Step 3) Verify the public Key(id_rsa.pub) and Private Key (id_rsa) got created, authorized_keys file is also default exists in same directory.If doesn't present we need to create manually using touch command.










Step 4) Copy public key id_rsa.pub to authorized_keys as shown in above screen
Step 5) Copy public key to authorizied_keys file in server 2 (cloudglee.com_2)using scp





Step 6) Copy Publickey and Private key to Server 2 (CloudGlee.com_2).






Step 7) Verify Piblic key, Private Key and authorized keys in server 2 (cloudglee.com_2)





Step 8) Change the permission as per below on both the servers



Step 9) Validate SSH from server 1 to Server 2 and Server2 to Server 1.

No comments:

Post a Comment