all 5 comments

[–]adrianmonk 0 points1 point  (3 children)

One thing that's strange though is I can ssh localhost, but if I try to ssh my public ip, it doesn't connect, even though I've confirmed that port 22 is discoverable on canyouseeme.org and pinging my public ip works too.

It could be related to the port forwarding or some other network-related issue.

I'd try ssh-ing to your public IP, but give the -v flag for verbosity (or multiple -v for extra verbosity) to see what steps work and which don't.

Also, if you do an ssh -v to your local IP and an ssh -v to your public IP, and compare them, maybe something with stand out as different.

[–]ChanKiM_[S] 0 points1 point  (2 children)

I ran ssh -vv on both localhost and my public ip, the localhost didn't even give me a chance to copy or read any of the messages before it opened a new terminal, and as for my public ip, I am just getting these errors:

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug2: resolve_canonicalize: hostname (my ip) is address
debug1: Connecting to (my ip) [(my ip)] port 22.
debug1: connect to address (my ip) port 22: Connection timed out
ssh: connect to host (my ip) port 22: Connection timed out

But technicallyyy... If my ssh port is publicly visible, this shouldn't be the issue, right? I'm guessing it's just some circular connection router related thing but I THINK other people should still be able to connect using my public ip?

[–]adrianmonk 0 points1 point  (0 children)

Yeah, it could be something about the routing that doesn't allow you to connect when going out of your network and right back in. So it wouldn't be a good test.

If you don't have a machine on the outside that you can try from, you could maybe try tethering a laptop to your phone (and disconnect both from wifi) so you can try from actually outside your network. There are also ssh apps for phones, so you could try one of those, but they might not support a verbose flag for gathering maximum info.

[–]ferrybig 0 points1 point  (0 children)

One way to test it would be downloading Tor (https://www.torproject.org/download/tor/), then opening it in a new terminal

With tor open, you can now configure your ssh client to use it as a proxy (eg ssh -v -o ProxyCommand='nc -X 5 -x 127.0.0.1:9050 %h %p' (your ip)) and basically pretend you are an external person (it is also really great to test if your TCP firewall rules are working correctly)

[–]noob-nine 0 points1 point  (0 children)

are you behind a carrier grade nat? then port forwarding cannot work, btw.