If install Hadoop on Mac OSX, make sure turn on Remote Login under System Preferences then File Sharing. This worked on my machine.
Remove SSH with the following command:
sudo apt-get remove openssh-client openssh-server
Install SSH again with:
sudo apt-get install openssh-client openssh-server
It will solve your problem.