Issue while transferring SSH keys to data nodes



0

Hello All

I am facing the issue while running this command to transfer ssh key to secondary name node and data node.I am able to see Public key got generated /home/hadoop/.ssh/id_rsa.pub and /home/hadoop/.ssh/authorized_keys but this command $ ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub hadoop@192.168.75.135 is giving me issue. Attaching SSH keygen logs also. Please see the errors in oragn

 

hadoop@hadoop:~$ cat /home/hadoop/.ssh/id_rsa.pub > /home/hadoop/.ssh/authorized_keys

hadoop@hadoop:~$ ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub hadoop@192.168.75.135

/usr/bin/ssh-copy-id: ERROR: failed to open ID file '/home/hadoop/.ssh/id_rsa': No such file

        (to install the contents of '/home/hadoop/.ssh/id_rsa.pub' anyway, look at the -f option)

hadoop@hadoop:~$ ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub hadoop@192.168.75.135

SSH Implemetation Logs

========================================================================================================================================================

hadoop@hadoop:~$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): /home/hadoop/.ssh/id_rsa.pub

/home/hadoop/.ssh/id_rsa.pub already exists.

Overwrite (y/n)? y

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/hadoop/.ssh/id_rsa.pub.

Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.pub.

The key fingerprint is:

SHA256:mGGDDTwlR1m1r1H6paGwEOpL1wR4/rGyxOgaw2mh4NU hadoop@hadoop

The key's randomart image is:

+---[RSA 2048]----+

|   .oo+o...      |

|    oB.    .     |

|    o.O   . .    |

|    .= B   +     |

|. ...E= S o o .  |

|oo.+ o = = = +   |

|..* + = = o o    |

| . = + o         |

|  ..o .          |

+----[SHA256]-----+

hadoop@hadoop:~$ cat /home/hadoop/.ssh/id_rsa.pub > /home/hadoop/.ssh/authorized_keys

hadoop@hadoop:~$ ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub hadoop@192.16


1 Answer(s)


0

Hi Praveen,

If you have regenerated the keys after cloning the machine. You need to manually copy the id_rsa.pub and authorized_keys file to other machines. If the keys are reset you can't connect to machines you will get this error.

Hope this helps.

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password