Why SSH server on windows7 x86 failed, while SSH client working - hadoop

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)

Related

SSH using paramiko: Able to ssh into one MacBook, but not into the other. Both connected to so same Wifi and internet working

Background:
I have two MacBook Pro. Lets call them: Machine A and Machine B. Both are connected to the same WiFi network. Both have internet connection working on them.
Using the following python code (run from a third 'host' machine), I am successfully able to establish SSH connection with Machine A.
import paramiko
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('172.xxx.xx.xxx', port=22, username='aaaaa', password='bbbbb')
Issue:
When I try to establish connection with Machine B, I see the following error:
paramiko.ssh_exception.NoValidConnectionsError: [Errno None] Unable to connect to port 22 on 172.xxx.xx.xxx
Question:
Since individual machines have internet working on them, I am intrigued why one is able to establish SSH connection while other is not. I verified that the IP, username and password for Machine B is correct.
Please chime in with debugging suggestions
I have always used port 22 as the default in my code. Is there someway to determine the port# for Machine B?
PS- I am new to using MacBooks and paramiko. Maybe I am missing something basic here.
Issue resolved by enabling Remote login for all users in Machine B.

Steps required to SSH into Azure Windows VM from a Linux VM

Having created a Windows Azure VM and opened ports 3389 and 22 for inbound RDP and SSH connections, respectively.
I can successfully connect to the vm via RDP from a remote Windows PC.
Testing SSH connection in the Portal succeeds. However trying to connect from a remote Linux VM using SSH fails.
Given that SSH connection test within the portal succeeds, it suggests that (1) it is possible to SSH into a windows VM; and (2) there is no other config require on the server ie installing OpenSSH (or similar) / Copying over key file(s) to some location etc. However, the help steps in the Azure Portal for my Windows VM, for making remote SSH connections suggest that maybe a public key needs to exist on the server and that I need the private key on the LinuxVM I am trying to connect from.
Please could someone help me understand if ssh into windows Azure VM is possible and if so, the requirements / minimum set of steps (on the target Windows VM and the source Linux VM) I need to get to a state that I can successfully SSH.
Other posts re similar question posted have not helped me connect via ssh. I have not found a 'golden source of truth' on Microsoft docs. Maybe I missed it.
Thank you.
A Windows Server doesn’t typically come pre-built and ready to go with SSH access and it requires some setup. You can follow this to set up your Azure VM for SSH access. You can configure SSH on a Windows Azure VM for access, check out How to Set Up OpenSSH on a Windows Server. After deploying the OpenSSH, you can follow the steps about connect via SSH with client in the Azure portal on your Linux client to access that Windows VM via SSH.

FTP upload returns 530 on Debian/Google Compute Engine, works ok on local Windows

I am uploading a file to an FTP server via a node.js script. Everything works fine on my Windows machine, but once I run the script on a Compute Engine instance, I get Login incorrect.
Since it works ok on a different machine, I suspect it must be a compute engine setting that messes up the connection.
Running the script with sudo doesn't help.
iptables are empty
Firewall rules in the Cloud Console are set to allow all ingress and egress
traffic, on all protocols/ports, all targets.
I am out of ideas where to look and will be grateful for any pointers.
FTP 530 error code indicates that there was issue logging in to the remote FTP server using the provided credentials (i.e. username and password).
530 Not logged in.
Since you actually get a 530 error, it indicates you do not have any egress firewall issue for your connection from the GCE VM to your remote FTP server.
If the script works fine on your Windows machine, ensure the script is not pulling credentials from a location accessible only on your Windows machine.
Also, you can use any command line FTP client directly on your Google Compute Engine instance and verify if you are able to login to the remote FTP server using your credentials. If this works, you will have to debug and verify if the credentials used by the script are the same.

Is there a way to remote debug on a different subnet in Visual Studio?

I have a client who is remote. I need to debug some weird problem that none of my other clients are having. Before I try and set up a conference with this client, I would like to know if there is some way of remotely debugging our application.
I see that there are remote debugging tools available for Visual Studio, but from what I've read, I need to be on the same subnet. As the person is remote, this is not a possibility. Also, as I'd like to keep our connection secure, I would need to connect up some sort of encrypted tunnel (this is where I'm a little fuzzy as my networking skills are mostly theoretical).
As I understand it, an encrypted tunnel is a bridge to another (different) subnet. This is to ensure that those computers on the other side won't interfere with the local subnet computers.
So, because the client's computer is on a different subnet, I think that this is not possible. Or is it? Should there not be a way of making the client's computer show up as a virtual computer on my subnet, by forwarding packets from one subnet to another? I would think that this is theoretically possible, but I'm not exactly sure how I would go about this.
Also, at the moment, my current way that we connect to clients is through GoToMeeting, but I don't think that it supports tunneling. If not, then I may need some way of generating a tunnel, so I was also thinking of maybe using some SSH programme like PuTTY.
As I have said before, my knowledge of networking is quite theoretical, so if the tools that I am suggesting are not the correct ones, please correct me. (I'm a programmer, damm it! Not a network engineer!)
Both computers are Windows boxes. Windows 10 (client) and Windows 8.1 (development).
If you can connect to an ssh server in the remote network, you can (subject to configuration on the server) create a tunnel such that you connect to a socket on your local pic and the connection appears from the server to an endpoint on the remote network.
You'll want to investigate the -L command of OpenSSH, which combined with the PuTTY docs, should help explain what's required.
By default, the endpoint would be a port on the ssh server, but it could be a port on a different host that the remote server can connect to.
I'm not familiar with the current state of Windows SSH servers, but even if there isn't a system server to hand, you should be able to have on run 'on demand' - if you run it on a non-privileged port and by the user you want to connect in as, it shouldn't even need Admin privileges.
I'm not familiar with GoToMeeting, but the one thing with SSH tunnelling it that IT depts should be familiar with SSH. If trying that, focus on getting a working connection in, then setting up the tunnel, then connecting through it as separate steps.
Once you have an SSH connection, then it doesn't need to do something itself, and you can then investigate connecting while specifying the port forwarding, but will will need to get the basic connection working correctly first.

Putty error : Unable to open connection to hostname : Host does not exist

I am using Putty to ssh into some of the servers that I work on. I am able to connect all others except the one. Although I was able to connect to it before. Whenever I try connecting to it, it always give me error:
Unable to open connection on myhost: Host does not exist
My firewall is off and I have even re-installed putty but that did not fix it. When I tried connecting to the same server using putty on some other windows system, I was able to do so. I searched regarding this on Internet but did not find much relevant.
I am running putty on Windows 7.
What can be the possible issue?
As I understand you have three computers involved. At the same time one connection is working and the other one fails. So we can exclude that the ssh daemon on your linux box is hanging.
In lack of knowing their real names I will call your computers linuxbox (this is the computer you want to ssh into), win7ok (that is the computer that you are able to ssh from using putty) and win7fail (that obviously is the computer you can't connect from).
Please do a tracert from both Win7 computers:
tracert linuxbox.your.domain
tracert linuxbox
Add the results to your question as it will help us find out what is happening.
Perhaps it is also a good idea to determine the ip address of the linuxbox from win7ok:
ping linuxbox
or
nslookup linuxbox
Then try to connect from win7fail by using the ip address of the target computer, perhaps it is only a DNS problem (which might be as nmap is failing too).
To make all of this easier to understand for us please provide the real names of the computers as you use them in putty.
For me the problem was with the Url of the reposity. Check remote URL. It must start with git#github.com, not https://.
I used nslookup and then used the ip address it gave me to connect and it worked
I had a similar problem with GitExtensions. The solution was to remove the https url and replace it with git#gitlab....
WRONG:
GOOD:
I just went through this. I have a Cisco VPN I need to use to get through to the Linux machine I wanted to login to and check.
No Putty session would get through using the machines name.
An nslookup on the windows machine yielded the correct address.
I too connected right in via the ip address.
I tried to Google the error and it failed, so I suspected the wireless.
Disconnected and reconnected my WiFi and all was good.
I did it fast enough that open connections stayed open.
And new connections refering to DNS names worked fine.
Seems like maybe some cached DNS addresses were stale.
Your DNS cache stores the locations (IP addresses) of web servers that contain web pages which you have recently viewed. If the location of the web server changes before the entry in your DNS cache updates, you can no longer access the site.
Following CLI command will do the trick:
ipconfig /flushdns

Resources