Answer the question
In order to leave comments, you need to log in
Reverse SSH, external connection. How?
There are two computers connected to the Network via LTE modems (that is, they are located behind the operator's NAT), I am sitting at the first one, the second one is at home. There is an OpenVZ virtual machine with a white IP belonging to some example.org. On the home computer, a reverse SSH tunnel was opened with the command from root:
/usr/bin/ssh -f -N -R 2124:192.168.0.1:22 [email protected]
When I go from my computer to and then from its interface I go to , I find myself on my home computer. But when I try to go there right away , I getssh [email protected]
ssh [email protected] -p 2124
ssh [email protected] -p 2124
ssh: connect to host example.org port 2124: Connection refused
Where did I go wrong in the setting? Answer the question
In order to leave comments, you need to log in
A. Understood, it seems. OpenVZ does not imply a working NAT, so what is on the localhost does not necessarily look external. It's time to move to KVM.
And if you are too lazy to move, then:
In general, I, as usual, forgot to think. -A - authorization forwarding.
-R 2124:192.168.0.1:22
Here port 2124 is exposed to the internal interface only. It is necessary to write with an external address. For example, if the external address is 8.8.8.8, then:
-R 8.8.8.8:2124:192.168.0.1:22
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question