1

I have two Linux systems

One is the client and the other is the server

I put two systems in one network and was able to connect to the server via a local ip

It means as follows:

ssh [email protected]

But now I am trying to connect to the server through the public ip that I requested ... I got my public address from the following site

https://api.ipify.org

I got my public address from the site above and tried to connect to it via ssh

‍‍

ssh ahmadreza@public_ip

But the connection was not established and I made the following error

ssh : connat to host <public_ip> port 22 : connection  timed out

I checked my port forwarding

I also made sure my port was on 22

But the problem still persists and I can not enter through the public address

2 Answers 2

0

TL;DR You are likely behind NAT

  • You need to set up port forwarding from your router;

  • But first of all, you need to pay your ISP for a public IPv4.

This is not solvable without having your own public IPv4 assigned on your router and forwarded the SSH port from there to your client. Sorry.

0

I found the problem I am using tp-link modem, I forgot to forward port 22 which is related to ssh in my tp-link modem

I used the following tutorial

https://portforward.com/tp-link/td-w8961n/

If you use tp-link, be sure to search for your version forward

1
  • Good to hear that you got it solved. I'm not sure this should be a separate answer since the existing answer that you accepted says essentially the same thing (i.e. you needed to port-forward). Linking to that particular tutorial for TP-Link would probably have been better as a comment (or edit) on the existing answer. Commented Feb 14, 2022 at 14:49

You must log in to answer this question.

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