0

I have an openssh server set up on my homelab that I want to be able to connect to remotely. I have forwarded the port and tried to connect to it on LAN using the public ip of my homelab. However I can't seem to connect to it.

I tried to connect to it on LAN using the public ip of my homelab. At first it didn't work because I didn't know about nat hairpinning. But still after using a vpn I get a Connection timed out thrown at me. What could be the problem?

I run the ssh service on port 8213 and have changed it in the /etc/ssh/sshd_config file also, and of course restarted it with systemctl. Could running it on this port instead of 22 be a possible cause?

9
  • Do you see the TCP packets arriving at your system? Do you see any replies being send out, and are they being sent out through the correct interface? Commented Jun 12 at 9:42
  • @grawity_u1686 When i run sudo tcpdump -i any -p port 8213 and try to remote ssh into the system, I get 0 packets received/filtered on my server. Thus also no replies are being sent out. Commented Jun 12 at 14:07
  • Were you connecting to your home IP address or the VPN-provided address? Commented Jun 12 at 14:15
  • @grawity_u1686 I tried to connect to the server's public ip while using a vpn Commented Jun 12 at 14:18
  • How did you determine that address, though? Does the VPN service allow inbound connections in general? (Most don't.) Commented Jun 12 at 14:37

1 Answer 1

0

Turns out I entered the wrong public ip for the ip to connect to in the ssh command.

If someone were to be in the same situation and isn't inputting the wrong ip, you could try the following:

  • check your firewall
  • check port forwarding
  • restart any related services (ssh/firewall)
  • try to remotely connect to the server by using a vpn or connecting to another network (in case the problem is caused by nat hairpinning)
  • run tcpdump -i <interface> -p port <ssh port> in root to check if the ssh request arrives at the targeted ip

Thank you @grawity_u1686 for helping me.

You must log in to answer this question.

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