how to make passwordless communication between multiple hosts

 

Sub: while doing cluster environment we required multiple nodes. hence for this, all servers should communicate with each other without credentials 

EX: for example, three nodes like host1, host2, and host3 are 3 servers

when you are in host1 terminal you can directly be moved to host2 without any new terminal by

 > ssh host2  [ now without asking password you will be moved to host2 from host1 ]


Setup :


1.  vi /etc/hosts

2.    Adding related hosts  in all places.

Ie., 

hostip1 hostname1 

hostip2 hostname2

hostip3 hostname3

3. SSH communication  [Generate SSH key passwordless]

 

[root@Host1]# ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

/root/.ssh/id_rsa already exists.

Overwrite (y/n)? y

Enter passphrase (empty for no passphrase):

New Section 1 Page 3

Enter passphrase (empty for no passphrase):


4.  ssh-copy-id root@hostname.com

The authenticity of host 'hostname.com (-.-.-.ip)' can't be established.

ECDSA key fingerprint is 4b:40:c5:15:7b:80:dc:ab:db:36:80:47:9a:30:d8:7a.

Are you sure you want to continue connecting (yes/no)? yes

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

root@host2.informatica.com's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@hostname.com'"

and check to make sure that only the key(s) you wanted were added.


5. Similarly do it for cluster also…


 


Comments

Popular posts from this blog

Convert Swagger apis into jmeter script

Script for replace the data into the file content using groovy with jsr223

Jmeter Preprocessor to add Dynamic parameters