0

I'm trying to connect to my server (Ubuntu Server 16.04) from a remote host via ssh. I've followed all the procedures to install ssh server properly on both machines. I disabled all UFW and 'ACCEPT' everything (input, output, forward) in the iptables.

I forwarded port 22 to the server on my router (technicolor tg789 v2), and disabled the firewall. I set the server IP to static and am using a Dynamic DNS (noip). I set ssh key on the machine I want to connect from and I can connect to the server locally using that (without using a password).

The ssh config file is configured as specified in other tutorials and answers so that ssh listen to all adresses.

The problem seems to be that port 22 (or any other port i tried) is not reachable from the internet, since when I check on canyouseeme.org it tells me connection timed out (same thing it tells me when i try to connect from another network). Everything is configured just fine (or at least as it seems it should be reading other tutorials and threads).

I've read lots of tutorials and questions on the web, but I can't figure out how to fix this. It's very annoying, can anyone help?

EDIT:

I've tried to connect to a MySQL server on the server using port 3306, but still no luck, I can only connect locally. (I forwarded the port first) I disabled the router's firewall too. Here are some output from the server configuration:

netstat -tln

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::3306                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN 

#

iptables -L

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  

#

ufw status
Status: inactive
  • If you can connect locally, the problem is probably either the dynamic DNS having an incorrect IP address or the router not forwarding the port properly. Try finding out the actual IP address (search from within your LAN for What is my IP address? on Google) and connecting from outside your LAN using that IP address instead of the domain name. – Chai T. Rex Dec 5 '16 at 21:56
  • Some providers will block connections for dynamic addresses – Kyle H Dec 5 '16 at 22:30
  • Already tried using the public ip, doesn't work. The DDNS is pointing to the correct IP. The whole thing doesn't make much sense to me. Thanks for your help – gionni Dec 6 '16 at 9:15
0

I live in italy my ISP is fastweb and they don't automatically give each user a public IP adress. I have to ask for one otherwise the IP i'm actually pointing at is theirs.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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