My server runs Ubuntu Server 14.04. When connecting over SSH from a local LAN client it works fine. When I connect using a different machine from an outside network, I get 'connection timed out'.
I cannot figure out why.
My router is configured to forward external port 51887 to port 22 on the Ubuntu server, and to forward a second port 51888 to port 22 on my Macbook.
Connecting to the SSH server on the Macbook -in the same LAN as the Ubuntu server- and from the same remote client, works fine. So that leads me to conclude the problem is not in the router/port forwarding.
I have tried running the SSH server on Ubuntu on a non-standard port 22000 (and updated the port forwarding rule) with no change in result.
I have verified that ufw and iptables are not active. I changed none of their default settings since installing the server.
I have been looking at /var/log/auth.log and I can see the local connects but there is nothing logged for the remote connects, suggesting they do not reach the server?
So I can connect to the Ubuntu server over SSH locally, and I can also connect remotely to the Macbook over SSH, but I cannot connect remotely to the Ubuntu server.
I'm stumped, having spent several days on this and reading tons of askubuntu topics and other resources. Anyone with a good suggestion?
EDIT: Output of netstat and iptables:
myuser@server:~$ sudo netstat -natp | grep 22 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1291/sshd tcp 0 0 192.168.192.61:22 192.168.192.29:58672 ESTABLISHED 1645/sshd: myuser tcp6 0 0 :::22 :::* LISTEN 1291/sshd myuser@server:~$ sudo iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination