Set passwordless SSH for hadoop

This post will describe how to set passwordless SSH for master node and slave nodes.

First on master node, generate SSH key using below command,

ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa

Above command will generate key file in ~/.ssh/ directory.
Now copy this key to authorized_keys file on master and/or slave nodes
for master node,

cat ~/.ssh/ >> ~/.ssh/authorized_keys

for slaves,

ssh-copy-id -i $HOME/.ssh/ user@slave-node-ip

Above command will prompt you password for slave node

Now test SSH with master and slave. It should not prompt you for password.

ssh user@master-node-ip
ssh user@slave-node-ip

If you have just single node setup where master node is also a data node then just follow instructions for master node.

ssh user@localhost

Leave a Reply

Your email address will not be published. Required fields are marked *