What's new

Weird SSH Problems

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mew1033

Occasional Visitor
I've been having two strange SSH related problems for the last little while.

  1. I have a remote SSH server I connect to. When I'm on WiFi behind my AC68R with Merlin 380.68, I often can't connect. Sometimes it'll connect, but it'll be incredibly unstable. The connection will timeout for minutes at a time.
  2. I can almost never SSH directly to the router itself.
The weird thing is that both of these problems are solved if I go through a different machine on my network. I have a separate linux box that is plugged directly into this same router. If I SSH from my laptop to that box, then from that box to my remote SSH server (1.) or the router itself (2.), I never have a problem.

Any ideas?
 
"I can almost never SSH directly to the router itself."

So that sounds like the root of the problem. Ideally, your syslog should give you a clue as to why you are unable to connect internally to the router. And if you have a syslog entry from one of the rare occasions when you do manage to connect to the router, a comparison of the 2 entries might just give you ideas for where the problem is.

Failing syslog giving up clues, does the problem persist after a reset to factory default settings? You could use John's nvram save/restore utility to back up your settings or, because you won't be changing firmware versions in between, you could use the in-built backup and restore of your settings in the webui. However, if the problem is somehow with a setting, you would re-import the problem after the reset. However, don't let that put you off. At worst, you'd simply manually re-enter your settings.

I assume you currently have the "allow SSH password login" set to No; have you tried switching it (temporarily) to Yes and trying to login to the router (internally) with SSH just using the router's username and password?
 
I've been having two strange SSH related problems for the last little while.

  1. I have a remote SSH server I connect to. When I'm on WiFi behind my AC68R with Merlin 380.68, I often can't connect. Sometimes it'll connect, but it'll be incredibly unstable. The connection will timeout for minutes at a time.
  2. I can almost never SSH directly to the router itself.
The weird thing is that both of these problems are solved if I go through a different machine on my network. I have a separate linux box that is plugged directly into this same router. If I SSH from my laptop to that box, then from that box to my remote SSH server (1.) or the router itself (2.), I never have a problem.

Any ideas?


By any chance, did you change the SSH port number on the router?
 
By any chance, did you change the SSH port number on the router?
I did indeed. I've been running it on port 222 instead of 22.
Do you think that would cause these strange issues?


I checked the syslog. This is all I see when attempting to connect from my laptop:
Code:
Sep  2 11:22:08 dropbear[28117]: Child connection from 192.168.5.4:22293
Sep  2 11:22:29 dropbear[28117]: Exit before auth: Error reading: Connection timed out
 
Indeed possible. Pick a port outside the reserved range of port numbers (beyond 1024). I have a five-figure port number not in any way similar to 22 or 22222 etc. Do let us know what happens.
 
Indeed possible. Pick a port outside the reserved range of port numbers (beyond 1024). I have a five-figure port number not in any way similar to 22 or 22222 etc. Do let us know what happens.
I tried with port 2222. Same symptoms.

I just did a little more testing with my internal server. If I connect to my internal server (on a 192.168.x.10) over SSH, no problems at all. Then I add in local port forwards that look like this:
Code:
-L 1234:remote.host:22
-L 5678:192.168.x.1:222
Then I SSH from my laptop to localhost:1234 and localhost:5678.
Both work perfectly. It's like WiFi devices are blacklisted both from accessing the router or even SSHing out through it.
 
Are you saying that, for example, with an ethernet-cable-connected device on the LAN, connecting simply to router by SSH (no forwarding, just connecting) will work, but if you unplug the ethernet cable and try to connect wirelessly using the identical SSH command and switches, it doesn't connect?
 
Are you inadvertently connecting to a guest wireless network with access to intranet disabled?
 
Are you saying that, for example, with an ethernet-cable-connected device on the LAN, connecting simply to router by SSH (no forwarding, just connecting) will work, but if you unplug the ethernet cable and try to connect wirelessly using the identical SSH command and switches, it doesn't connect?

Yes, that's correct. I am able to connect over WiFi about 1 in 10 times. Although when I do get connected, it almost always drops out after a few minutes.

I just did a factory reset. The only new settings I configured are LAN IP, Wireless, and SSH. Same issue.
 
Well, it still does it after factory reset! And does the syslog show anything about it disconnecting?

Interesting, it's not all or nothing: on the odd occasion it does connect, albeit briefly.

Have you tried different wireless bands, and different channels in the same band? Can you use an app or program to look for interfering wireless signals? Anything using similar frequencies eg baby monitors, cordless phones? If it's not neighbours' wifi interfering, could you perhaps try unplugging all wireless devices? Any wireless range extenders in the house?
 
Make sure you don't have both the ethernet and wifi connected at the same time. This results in a duplicate hostname, which the router sometimes doesn't deal with too well. (When it does work right, one of the connections will change to a hostname of '*' and essentially be disabled).
 
I've been having two strange SSH related problems for the last little while.

  1. I have a remote SSH server I connect to. When I'm on WiFi behind my AC68R with Merlin 380.68, I often can't connect. Sometimes it'll connect, but it'll be incredibly unstable. The connection will timeout for minutes at a time.
  2. I can almost never SSH directly to the router itself.
The weird thing is that both of these problems are solved if I go through a different machine on my network. I have a separate linux box that is plugged directly into this same router. If I SSH from my laptop to that box, then from that box to my remote SSH server (1.) or the router itself (2.), I never have a problem.

Any ideas?

It's likely not the router - check your SSH client...
 
Well, it still does it after factory reset! And does the syslog show anything about it disconnecting?

The syslog sometimes shows the initial connection, then nothing else. When my SSH client times out, the syslog will show a timeout as well. It'll say
Code:
Sep  2 11:57:27 dropbear[1913]: Exit before auth: Error reading: Connection timed out
 
What are you using? Putty?
Kitty, it's a fork of putty. But it looks like I'm having the same issues when I use bash on the linux subsystem for windows. Maybe something weird is going on with my network adapters...
 
Kitty, it's a fork of putty. But it looks like I'm having the same issues when I use bash on the linux subsystem for windows. Maybe something weird is going on with my network adapters...

Maybe, first thing I would look at is nuking the kitty settings file, and start over...

Happen on both wired and wireless?
 
Maybe, first thing I would look at is nuking the kitty settings file, and start over...

Happen on both wired and wireless?

No, that's the weird thing. Wired: No problems at all. Everything works perfectly. Wireless: Nothing but trouble.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top