Monday, January 14, 2013

Password-less authentication userful for Hadoop Administrators and linux users

Although Hadoop never requires any password-less authentication to communicate between nodes, but from Hadoop administrator perspective it provide a great flexibility while managing multiple nodes together.

a. Generate the SSH private/public key pair for hadoop user in Namenode

i. ssh-keygen –t rsa


b. By default it will be created in ~/.ssh directory in the name of id-rsa.pub

c. Since Hadoop user was create by the Hadoop rpm without a password, so copying the public key using ssh-copy-id command will not work.

Copy the public key from the Namenode to every data node and secondary name node using scp command using loginid user.

i. scp ~/.ssh/id-rsa.pub loginid@IP:/tmp

e. Then log into every system as hadoop user and copy the id-rsa.pub as ~/.ssh/authorized_keys

i. mkdir ~/.ssh

ii. cp /tmp/id-rsa.pub ~/.ssh/authorized_keys

f. Set the permission for .ssh directory and authorized_keys file

i. chmod 700 ~/.ssh

ii. chmod 644 ~/.ssh/authorized_keys

Once the password-less authentication is done it becomes very easy for the administrator write a single script to execute same command throughout the cluster from namenode.

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...