0

I am running Lubuntu 14.04 and have set up an SSH server. It has taken me ages to troubleshoot because of a confusing fact.

At home I can SSH my laptop from itself using either my local IP address (192.168.0.x) or my public IP address (router port forwarding set up properly).

If I take my laptop, as is, to my friend, I can only SSH myself using my local IP address but not using my friend's public IP address. Aha, you think, it is because port forwarding is not set up properly in his router. Well, this is the confusion: it is set up properly, as far as I can tell. Namely, I can indeed SSH my laptop from a computer outside his network using my friend's public IP address. Using the public IP address from within his network causes the login to stall.

If I do, from within his network,

ssh -v *public_IP_addess*

the last two lines to be output before it stalls are

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3

whereas doing the same command from outside his network is successful, and the couple of lines following the lines above are

debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3

debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000

...

How can this behaviour be explained? Why can I use my public IP address when I am at home but not at my friend's place?

2
  • 3
    Port forwarding does not necessarily guarantee NAT loopback - perhaps your friend's router doesn't support that? Jan 30, 2016 at 15:44
  • @steeldriver - You seem right. Thanks for the link. I've done some research and apparently the ISP (who provided the router) has disabled many features, including NAT loopback. So this was indeed the problem. If you answer my question I can tick it off as answered. (This issue has caused me so much headache!)
    – DustByte
    Jan 30, 2016 at 16:24

1 Answer 1

0

It looks like you are failing to set your username ssh USER@<ipaddress> If you don't declare a user name it use the current user. Since you are on a friends laptop you are essentially doing ssh wrongUSER@<ipaddress> The password or key that you then use doesn't match this nonexistent user. I'm guessing that you are using the same user name on both of YOUR machines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .