SSH with PuTTY inconsistent connectivity

The setup:
I have two Raspberry Pi devices with fresh installs of OSMC.
One (Den) is hard-wired and the other (Pink…don’t judge) is WiFi.
Both were DHCP.
VNC is installed on both.
Out-of-the-box, PuTTY connected to either without issue with default login. (I’ll change the passwords later)
VNC works perfectly as well.
I use the same Windows 7 laptop with PuTTY version .7 64-bit to connect.
I also have a keyboard and mouse connected to both devices in order to verify their network configurations and OS response.

The change:
I setup Den to a static IP outside of the DHCP range.
I can still ping both by IP and hostname. I can also verify their hostnames and IP addresses in the devices table on my router.
That is the only modification I have made between the two devices.

Now, when I attempt to connect to Den, I receive the dreaded “Network Error: Connection timed out”
Through the OSMC GUI, I have verified the IP address, hostname and its internet connectivity.
I can successfully ping both devices’ name and IP from the laptop.

Note: I am able to SSH into Pink and connect with VNC without any issues. SSH and VNC respond immediately and remain connected until I exit. It is still set for DHCP.

This morning, I attempted to connect to Den. It prompted with the typical SSH first time connection message to save the key. (I had removed all the host keys from the Windows registry to detect any change in connection behavior). It allowed me to login. YAY!
Then, while I was navigating the directories, I got the next dreaded error of “Network Error: Software caused connection abort”.
In searches on Google, there are suggestions of changing PuTTY options for StayAlives and so forth. I have never needed to modify these settings before and it remains connected to Pink without these changes being made.

UPDATE: I am now receiving “Network Error: Connection refused” when attempting to connect to Den.
I am still able to successfully ping both name and IP for Den.

I have no Port Forwarding set on the router for SSH, so there is no access from the unwashed Web to exploit.

I think I’ve covered everything, as regards the connection to Den.

Thanks in advance for any help!


Stupid question here, but I would double check nothing else is usings den’s static IP or hostname?

Thanks Tom.

Your post, though quite comprehensive, could probably benefit from a bit more specific data. For example (but not restricted to):

  • What are (and were) the IP addresses?
  • Is the laptop using a wired connection or wifi?
  • Can you ssh from one Pi to the other?
  • What happens if you revert Den to a DHCP-acquired address?
  • Are you using avahi names for the device, eg den.local?

Might not be helpful, but anyway - Not sure what your router/DHCP-server can do, but I just define a permanent DHCP loan using MAC address and leave the client using DHCP for any client that should have a fixed IP. Has worked flawless for me. It works with IP numbers both inside and outside the automatic DHCP range on my current router.

That’s a fair question. The answer is no, there isn’t another device with that IP. The DHCP range is only 11-25 and Den’s IP is 200.
However, in looking at the service status for both SSH and VNC, I discovered something else kind of odd: while there weren’t authentication failures for SSH, there were for VNC. Different Class A IP addresses after several restarts of the Raspberry devices. This lead me to look closer at the Port Forwarding on this AT&T router. VNC was listed as allowed application associated with the 200 IP address. Then I remembered that I had forwarded VNC a couple of years ago to a CentOS server I had on my network, but not on this router. It was a previous DSL router, not the UVerse router I have now. (??)
I killed the forward, however there was another oddity: when I looked at the VNC service on Pink, there was a similar Class A IP authentication error. Not the same IP as I saw on Den’s service.
Weird that the VNC service on two different devices had authentication failures…
It causes me to wonder if the UVerse router detected a VNC server running on the LAN and forwarded it automatically. I sure hope not, but I really don’t know to what else to attribute that. I can’t recall when I last had that CentOS machine on my LAN, so I can’t be completely sure I didn’t forward it.

Since I killed the forward, SSH and VNC are working as expected on both devices. Den is static and Pink is still DHCP.

As it appears that everything is working correctly now, the issue may be resolved…I hope.
Just for completion’s sake:

  1. Pink’s address was (and still is DHCP) .18 (WiFi) and Den’s was wired DHCP .16, but now is static at .200
  2. The laptop has been WiFi the entire time.
  3. I never tried to SSH between the Pi devices. I may yet try that, just to practice connecting from a LInux machine.
  4. I didn’t revert Den to DHCP once I discovered the forward, since the CentOS machine was once assigned the .200 IP.
  5. No, the names in the hostname text files are not avahi. Is that an advantage? If so, I don’t mind changing them.

If everything continues to work as it is right now, while I’m not completely sure about what the forward of VNC might have had on SSH, if any, I believe all is good.
My next step is to setup the SSH public/private keys. I’m sure I’ll have questions about that, too…lol

Thanks guys for all the help!

El Grincho
Thanks for the suggestion. I set reserved IP addresses for printers on company networks I have managed in the past. It does work quite well. The only reason I don’t do that on my LAN is because I have a number of Raspberry devices I am setting up for friends/family. MAC addresses come and go pretty regularly. I also use the devices to strengthen my Linux skills, so their roles change from time to time as well.
Thanks again!

It is still exhibiting some of the same inconsistency issues.
I set the IP address for Den back to DHCP, which seems to be stabilized.
No more “Connection Refused” or “Software caused the connection to abort” errors…so far.
I’m going to leave PuTTY connected overnight to see if it drops for any reason.
Any idea, if it stays connected, why the difference between DHCP versus static?
I’ve also seen some conversations where VNC is referenced in the OSMC store, but when I look, I don’t see VNC as a selection.
This whole thing is driving me nuts. :wink:

That happens if you set the static to match the dhcp address? What you describe with inconsistent behavior is what I’d expect if some other system on your network is grabbing the static address you are using.

So try static == dhcp or
static == another address

The DHCP range is subnet.11 to subnet.25
The IP address of the Pi in question is subnet.200
There isn’t any other device using .200
I didn’t set the static to the DHCP. I set it to one completely outside the DHCP range.
Tom_Doyle asked that question too.

Thanks for your reply!

I’m suggesting that you set the static to the same as the DHCP to see if things change.

Or try a different static.

You don’t think anything is using .200, but maybe something is.

Right on!
I thought I had accounted for every device on my network.
I forgot about the Samsung printer! It is currently at .200
I had changed the Den back to DHCP.
Because you said something may (must) be using .200, I pinged that address and it replied.
Man, I’ve been looking at this for too long!

Your response caused me to catch a step I hadn’t thought of.

Thanks for your help!

Great! Sometimes the simple things escape us.

No kidding
The collaborative nature of talking to other people can trigger the “Ah ha!”
Thanks again!