1

I am a beginner in hadoop, and I am trying to set-up hadoop cluster in fully distribution mode. My master is windows and my slave machine is Linux running on VM. I have created SSH keys and in both windows and linux and have copied the public key from my master windows machine to Linux slave machine. Hence I am able to SSH from Windows to linux by using the below command without giving password

ssh [email protected]

where 10.0.0.227 is the IP address of my slave Linux machine and I am able to access the linux from windows. But when I try to do the other way (SSh from my slave linux to my master windows) I am not able to connect and I am getting the below error:

sriram@sriram-virtual-machine:~$ ssh [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied (publickey,password,keyboard-interactive).
sriram@sriram-virtual-machine:~$

where 10.0.0.202 is the IP address of my master windows machine.

i tried to copy the public keys from Linux to windows and I am not able to do that as well

sriram@sriram-virtual-machine:~$ ssh-copy-id -i /home/sriram/.ssh/id_rsa.pub          
[email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to   
filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are    
prompted now it is to install the new keys
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied (publickey,password,keyboard-interactive).

Could you please guide me as I am struck at this point. is it fine to have SSH working from Master to slave alone or is it necessary to have the SSH work both the way (Master to Slave and Slave to Master) to have hadoop run in pseudo distribution mode? Please advise me on where I am going wrong. I wanted to connect without password

I am using cygwin in windows and have the SSH and keys created in windows using it. I do not have external client such as Putty. And having keys created, I am able to connect from windows(Master) to Linux(Slave).

Sorry, I updated IPAddress wrongly. Now I have them updated. 10.0.0.227 is the IP address of my master(Windows) machine 10.0.0.203 is the IP address of my slave(Linux) machine.

1
  • On Windows, are you using the most up-to-date version on Win32-OpenSSH? If so, change LogLevel to LogLevel = DEBUG3, restart the server, attempt the SSH connection again from Linux, then review the server's log to determine why the server is rejecting your key. Just an FYI, Windows' %ProgramData%\ssh\sshd_config should be customized and I provide a general template here.
    – JW0914
    Dec 8, 2019 at 13:15

1 Answer 1

1

Apologies for posting this as an "Answer", but I don't yet have enough rep in this forum to add a comment.

The key to this (if you'll pardon the pun) would seem to be, understanding what is providing the SSH service on your Windows system -- unlike Unix-like systems, Windows does not (yet) have a built-in SSH service. Clearly you DO have a SSH server running on 10.0.0.203, otherwise you'd get a "Connection Refused" error.

If it's something like the Cygwin SSH server, you will need to copy the public key of your account in the VM (the file is ~/.ssh/id_rsa.pub or similar) into the .ssh/authorized_keys file of the sriram account as far as the Windows SSH server is concerned.

However, this may well not be required, since I'm pretty sure Hadoop only uses the master->slave connection to get the services started, and other communication doesn't run over SSH.

4
  • I have updated my question. I have cygwin installed which does the SSH in windows for me. Also I have transferred the public key from Windows to Linux as suggested by you already. But I am not able to do the same from Linux to Windows. From your answer, do you mean to say since my master (Windows) is able to connect to my slave (Linux), that should be suffice for hadoop fully-distribution mode? Mar 3, 2016 at 16:38
  • Try starting the ssh daemon as non-forking on the Windows box. (use the "-d" switch and run it from the command line). One of the things that sshd checks is that no other user can access the public key file, or the directories leading to it. Running in debug mode will help track down problems like this. Mar 3, 2016 at 17:29
  • Thank you. By starting ssh daemon, will I be able to edit certain configurations to access public key from remote?. Do you have any documentation in handy? I would try to do some analysis and update you. Mar 3, 2016 at 17:35
  • See linux.die.net/man/8/sshd for the sshd manpage. It's a case of starting up the ssh daemon in the foreground, so you can see exactly what's going on when it receives a public key from the client, and why it did not accept it. Mar 3, 2016 at 21:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .