0

I am running a server at my house with SSH enabled on it, and I have given it a static IP of 192.168.0.212, and set up the dynamic update client to keep the No-IP dynamic DNS updated.

When I am on my internal network at home, I am able to use the Dynamic DNS address to access my server inside the network fine. However, when I am away from my local network and try and access SSH, it fails with "ECONNREFUSED" (Connection Refused).

What is the problem with this, and how do I get access to my server from outside my network?

  • 1
    Did oyu change any of the port forwarding rules on your router? – Thomas Ward Jun 19 '16 at 18:40
2

Since your local network works, but remote doesn't, you need to check your router settings.

Specifically, you need to enable port forwarding for port 22 (or another higher port and then configure the SSH server to listen on that port) from the outside to the server IP on the inside of the network. This process varies from router to router, so you may have to look for a guide to set up port forwarding on your router.

As well, consider that a good portion of ISPs block port 22 inbound to residential IPs - not every ISP is okay with you running a server internally on a residential-class connection.

  • The situation is little bit diffefent. On my computer, on local network I can use both local IP of the server or Dynamic DNS address to access my server, they both work. I can use Dynamic DNS address to see default Apache page, I can enter webmin with 10000 port, I can manage my server with SSH. But when I connect my Android phone to same network (wifi) and try to use same Dynamic DNS address, SSH app gives "connection refused" message. But local IP address of the server still works. Strange, but it seems like Dynamic DNS address works but only on my computer on local network. – Orkhan Ahmadov Jun 19 '16 at 20:49
  • @user4459321 Check if the DDNS resolves from outside - nslookup DDNSADDRESSHERE 8.8.8.8. If it resolves from the outside then port forwarding is the likely culprit, or the ISP is blocking that port (and you will have to configure a much higher different port). It is almost never the case that it's the Dynamic DNS address at fault, but router configurations (port forwarding must be on for all those ports to go from the outside in) or ISP filtering of the ports. – Thomas Ward Jun 19 '16 at 20:51
  • So I ran nslookup. It shows "Non-authoritative answer. Name: DDNSADDRESSHERE.ddns.net, Address: 185.43.***.**". The IP address is shown at the result is my home network's global IP address. – Orkhan Ahmadov Jun 19 '16 at 21:09
  • @user4459321 The issue then is not the DDNS address, then. Have you gone into your home network's router, and made sure that port 22 is forwarded to the internal IP, as well as any other services you want to have made web-facing by setting those ports to be forwarded to the internal IP address? If you have not, that is the issue. Note also that ISPs sometimes block port 22 for security/protection reasons so you may have to configure SSH to work on a higher port in your server (and forward that one instead of port 22) – Thomas Ward Jun 19 '16 at 21:25

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.