1

I am a beginner in networking, so it could be that the problem is very basic...

I am trying to remotely SSH into a computer attached to my home network, and to do so, I first made sure that I could do a local ssh into the computer (within the LAN network on port 2222) which worked perfectly. Then I added a port-forward on the modem. Connecting external port 2222 to the correct port on the machine in question.

print screen of port forwarding

Whenever I try to connect to the ssh using my global IP:

ssh user@globalIP -p 2222

I get:

ssh: connect to host globalIP port 2222: Connection refused

It seemed like the port wasn't open, and this is confirmed by an open port checker tool.

print sceen of port checker tool

What can I do?

1
  • when you forward ports on a modem/router you need to specify both source and destination ports. You should also check your firewall settings so the global IP from where you try to access your machine is allowed to do this.
    – Alex
    Feb 4, 2016 at 14:49

1 Answer 1

1

Make "External port End" to 2222 and try again.

(edit from micha, (I can't log back into the guest account I made so I can't put this in comments) I tried to do this, but results were unchanged...)

Also, take a look at your firewall settings on your router itself. Some consumer routers I've noticed have a setting that will not allow any incoming connections on a port even if it is manually forwarded. Try quickly giving that a try to troubleshoot the issue.

Also please check to see if you have "DMZ" enabled on your router settings. If so, try disabling.

(edit by micha I checked the firewall settings, and it says it doesn't block the ports. I also checked DMZ which was already disabled. So I rebooted the modem, and the error changed to "connection timed out" (and it takes forever before it says so) If I do an open ports check now, it tels me the port 2222 is open)

(edit by micha You are a HERO, changing to another network did the job!)

4
  • This might be a silly suggestion, but have you tried to gracefully restart the router after doing these settings? I had a crappy E1200 at one point that wouldn't take the port forwarding settings unless you reset it after every change.
    – Ethereal
    Feb 4, 2016 at 15:56
  • Are you trying to SSH on a computer that is under the same router that you are trying to SSH to? IIRC this will not work. Try using a mobile device / mobile hotspot, friends internet, etc. Otherwise try following these suggestions: Make sure the computer that you want to SSH to has the SSH daemon running and that it is listening on port 2222. If you don't have it listen on port 2222 in the SSH config, then just change your "Internal Port" to 22 as in your router port forwarding and reset the router and try again. 22 is the default port. Also check the pc's firewall settings just in case.
    – Ethereal
    Feb 4, 2016 at 17:25
  • Glad to hear it works now!
    – Ethereal
    Feb 4, 2016 at 17:57
  • Micha, if you want to regain access to your account then you can create a new full account and then use the contact form selecting "I need to merge accounts" and putting in the profile links for both your new and old accounts. This will give you the ability to comment on, edit and accept answers to your question.
    – Mokubai
    Feb 4, 2016 at 21:31

You must log in to answer this question.

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