Recently I tried to set my Ubuntu 14.04 desktop computer (I will call it "computer A") as a ssh server so I could access it remotely from my laptop (I will call it "computer B"). I installed openssh-server, and up till this point have not modified the /etc/ssh/sshd_config file.
The problem is, I believe I set up everything correctly, and although I can access computer A from computer B through ssh using computer A's permanent internal IP address on the router while in the same network (and also through localhost within computer A):
ssh [email protected]
I cannot access computer A using the external IP address, as in:
ssh -vvv username@the-external-ip-adress
After a long while I get:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to the-external-ip-adress [the-external-ip-adress] port 22.
debug1: connect to address the-external-ip-adress port 22: Connection timed out
ssh: connect to host the-external-ip-adress port 22: Connection timed out
I tried connecting through the external address both from inside and outside the network. This adress I found it at canyouseeme.org and by googleing it. I also used canyouseeme.org with my IP and port 22 which is the one specified in my sshd_config by default and also finds it unable to access the service due to connection time out.
I have checked pretty much every forum and post about similar problems, sometimes of seemingly the exact same problem, but found no solution. Based on all what I have read, I provide screenshots with information about my router configuration (port forwarding and so on) that is or may be relevant.
I also:
- have enabled port 22 on my firewall ("sudo ufw allow 22")
- have tried disabling the firewall
- have tried reenabling the firewall
- have tried disabling the router's firewall
- have tried reenabling the router's firewall
- have tried adding the port to the iptables ("sudo iptables -A INPUT -i eth1 -p tcp --dport 22 -j ACCEPT")
- found the /var/log/auth.log only with local records
- found the /var/log/daemon.log empty
- have tried ping with 100% package loss
- have rebooted computer A
- have rebooted the router
- have checked for access restrictions in the /etc/ssh/sshd_config file but did not find any.
Any suggestions? Please keep in mind that I can perfectly ssh into computer A and use it from within the network and using computer A's IP local address, as well as localhost from within computer A. As far as I understand, this suggests that there's nothing wrong with the ssh server configuration of computer A. But I may be wrong.
UPDATE: I also recently noticed that the IP (external IP) is constantly changing (after very long periods of time), of course I always try to connect to the current IP. Could having a non-static IP have something to do?