I am able to SSH locally into MAC OS X on standard port 22. But when I try to SSH via public ip I get connection refused. I have forwarded port 22 on the router to MAC OS IP. When I run nmap local-ip port 22 says it open, but when I run nmap on public-ip port 22 says closed. So I think port 22 is closed on public IP, and I'm unsure how to open it. I'm still pretty new to ssh any help would be appreciated.
Asked
Active
Viewed 5,657 times
0
-
Where are you trying from? Inside your own network? – Daniel B Aug 07 '14 at 05:58
-
What address(es) is your SSH listening on? Daniel B, you are right, but the user gets "Connection refused" which would suggest the port forwarding is working but the server is refusing the connection attempt. I've seen this before and is almost always the server not listening to "all IPs" (like Apache on 0.0.0.0:*), an IP banning system is in use or the login credentials are incorrect... I would think an incorrectly forwarded port would result in connection timeouts...? – Kinnectus Aug 07 '14 at 06:54
-
Unless NAT reflection is used, the NAT gateway itself will try to answer the connection request. – Daniel B Aug 07 '14 at 08:32
2 Answers
1
Well the answer turned out to be rather simple for me. I live in an apartment complex, and at this time I share a public IP with all who live in the complex. I have to request my own public IP to get this working. However I hope others will benefit from the other comments and answers given!
EDIT: I suppose a solution for this is posted here
0
Verify if your ISP is blocking the port 22 (it's easy to search).
Also, be sure that your port forwarding is correct:
- IP source must be empty
- Source port is 22
- IP Destination must point to your computer local ip (which is given by your router and looks like 192.168.X.X [warning: 192.168.X.1 is your router])
- Destination port is 22
If your ISP does block port 22, a little trick that could work is setting the source port to 443 (SSL) [keep the destination one to 22], which is more often open that SSH. Be sure if you try to connect to your server from outside that you specified the port 443.
max890
- 251
- 1
- 5
-
Thanks, all of these I have verified, and are not the problem. See my answer. I think your answer may help some other though. – LJS Aug 07 '14 at 16:36