Wednesday, April 25, 2012

Passpharse less Ssh troubleshooting for Hadoop cluster setup.

In this post, I want share my debugging knowledge gained while setting up passphrase less login. I needed this to setup a hadoop cluster. The instructions on the setting up hadoop are straight forward on how to generate one but it does not mention about troubleshooting. Hopefully this might serve one!

Recently I have been working on hadoop for analyzing production logs. As a proof of concept, I wanted my hadoop job to be run in production like environment (instead of pseudo distributed environment). Hence was setting up pass-phrase less ssh. Generated the public key on the name node and copied this key into another remote machine. Following are screenshots of the steps.

1) Generate the rsa private/public keys and copy to authorized_keys. This will help facilitate localhost passphrase less entry.

2)  Copy public file to the remote server.

3) Append this key inside this file into authorized_keys. Create authorized_keys file if it does not exist.



After above steps, I was expected the setup should work and I tried to login. Surprisingly it failed, as it asked me to enter the password. After spending hour or so trying to figure what could be wrong, I came across this link which talks about how ssh client and server can be picky. In this page, the author mentions about file permissions. Hence I did quick check and it revealed that the permissions on local and remote files were different:
After changing the permissions, the login attempt succeeded.


If file permissions is not the issue in your case, here are few things that can be used to troubleshoot:
1) Check the public key is actually in authorized_keys remote node file.
2) Check for compatibility between ssh protocol version, solution is to force them to use version 2 using -2 flag.

No comments:

Post a Comment