1

I have an old Linux box (version 2.6.12, compiled by a colleague) behind an NAT-enabled router, that I want to access from a remote PC. There's an SSH daemon running on the box, but since there was no SSH client yet, we compiled an old Dropbear client, which works fine when creating a tunnel.

I should note that the SSH daemon is running on port 55000 and that the version of the Dropbear client is v0.53.

The problem arises, however, when using remote port forwarding:

./dbclient -N -R myserver.com:10022:localhost:55000 me@myserver.com

This prompts me for a password, and from myserver.com, I can see the connection was successful:

sudo netstat -tulpn | grep 10022
tcp        0      0 xx.xx.xx.xx:10022    0.0.0.0:*               LISTEN      31512/sshd: me

When trying to use the tunnel from my Mac or Ubuntu (OpenSSH_7.4p1, LibreSSL 2.5.0), however, not much is happening.

ssh -p 10022 test@myserver.com

Just hangs forever. The user 'test' exists on my Linux box. In verbose mode, I get the following:

ssh -p 10022 test@myserver.com -v
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/me/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to myserver.com [xx.xx.xx.xx] port 10022.
debug1: Connection established.
debug1: identity file /Users/me/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4

My knowledge of SSH is fairly basic and remote forwarding is very new to me, so I have no idea what to try next. I've tried a Dropbear client on Ubuntu and Mac, which just hangs as well. I don't think it has a verbose mode(?). I tried the reverse, i.e. setting up remote port forwarding in Ubuntu and then connecting from the Linux box and that just works.

Is it just some configuration problem? Could it be that the SSH daemon is not welcoming my connections and how could I check or fix that? Do I need an older SSH client on my PC's?

Any help is greatly appreciated!

EDIT: does sshd require any special configuration parameters or does this have nothing to do with sshd?

  • 1
    Do you have on myserver.com GatewayPorts option enabled? – Jakuje Jul 4 '17 at 10:30
  • @Jakuje I have GatewayPorts clientspecified – delucasvb Jul 4 '17 at 10:33
  • @RuiFRibeiro the reverse connection works perfectly, using Dropbear on both my Ubuntu PC and the Linux box – delucasvb Jul 4 '17 at 10:33
  • What about firewall/iptables rules on that server that could prevent remote connections to this port? – Jakuje Jul 4 '17 at 10:34
  • Haven't fiddled with those. It's a fresh install of Ubuntu Server 14.04.5. I don't think it's a firewall because the reverse connection works? – delucasvb Jul 4 '17 at 10:40
1

This will definitely not be the solution for most, but I'll post it here anyway, maybe it can help someone else in the future.

The problem was that on the Linux box, the loopback interface was down by default. I'm still not sure why. I figured it out by trying to SSH to localhost, which failed. Pinging didn't work either. After bringing up the loopback, everything worked:

ifconfig lo up

(The name of your loopback interface might be different, it depends on your OS)

I can only assume that behind the scenes, a local SSH connection is being made from the forwarding tunnel to the local SSH daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.