I am working recently on building Hadoop environment on windows7 OS. However, I got stuck in SSH configuration which blocks all the remaining work for Hadoop. I believe it's nothing to do with Hadoop, so any one familiar with SSH can do me a great favor.
Here's the thing, I'm trying to install SSH service for two computers so that any one can communicate with the other. I have successfully installed SSH for my PC, which is win7-x64, through cygwin. However, when I repeated it on the other computer, which is a server with win7-x86, SSH server failed, while the client can work, I get totally confused.
For my PC, I installed cygwin to use SSH service. ssh localhost
works fine. And after generating ssh keys and appending it to authorized_keys
, I managed to log in to my PC without password.
I copied the cygwin folder from my PC to the server, which is not connected to the Internet thus cygwin can't be directly installed on it. ssh localhost
turned out okay at the first. But when I attemptted to log in without password by generating ssh keys and appending to authorized_keys
, I got
Connection to localhost closed by remote host
Connection to localhost closed.
What's more, I copied the public key of the server to my PC and appended to authorized_keys
file. I managed to log in to PC from the server without password.
On the other hand, the SSH connection from PC to server failed no matter whether with or without password. I got the same failure:
Connection closed by 192.168.0.52
where 192.168.0.52
is the ip address of the server.
What makes me more confused is when I connected to server from PC using putty
rather than ssh
command, I could log in to the server, with password.
In conclusion, I hope it would make the question more clearer with this graph: ssh connection graph
I hope any one can help me to figure out what's wrong and how to fix it. Thanks a lot!
After trying for several centries, I finally found what's happening. When I built sshd service on the server, I didn't create a privileged account('cyg_server' by default), which I did on my PC but I forgot. Instead, I used current account for logging. Yet, the account , even the administrator, on windows doesn't have all the authorities as root on Linux does. Considering that, Cygwin considerately creates a privileged account named 'cyg_server', we just leave it and log in using current account. Everything is okay!
Again, f**k windows(So why would I have to do that on windows. Well, if I could, I would)