Strange SSH (dropbear) issue

I'm having a weird issue with dropbear/SSH.

Every time I connect with Putty, my connection gets refused, if I then wait approx 5-10 seconds and try again it works just fine. This happens on every connection, even if there is already an active SSH session open to that router from the same PC, if I try to create another Putty session; same thing 'connection refused' then retry and it works.

There is nothing logged on the router related to this.

Any ideas?

"Don't use Windows"

Only half kidding

I don't know how to get diagnostics out of PuTTY, but if you can get the equivalent of ssh -v with PuTTY (verbose connection diagnostics), that would help. Here's a link I found that might be helpful.

From https://centrify.force.com/support/Article/KB-5452-How-to-enable-debug-for-PuTTy-SSH-clients

Configuring PuTTY Debug Logs:

  • From the PuTTY Configuration, in the left pane, click on " Logging " under " Session ".
  • On the right, ensure " Log all session output " or " Log SSH packet data " is selected.
  • Note the path to the log file - this needs to be sent along with the sshd logs.

This kind of delay is common either because the network isn't "totally up" yet after OpenWrt boot, or a new key has been presented, neither of which are the case, from what I read.

Having two devices on your network with the same IP will cause strange things like this.

3 Likes
  • Did this behavior begin after any of your firewall work on this thread?
  • If so, what rules have you edited?
  • Are you trying to connect from this specially-firewalled VLAN you created?

No it's not related to that, it's been happening for a while.

I think it's Putty related. SSH from Ubuntu shell (on Windows) connects first time every time.

I'll log Putty when I get a moment.

Do you see anything in the logs of Openwrt for that failed attempt?
logread

If you're working with a saved profile in Putty - try clearing it out...