Say that I have a server A:1.2.3.4:1234
, which is an totally internal server cannot reach out any public services, such as apt
, pip
. And I cannot log in A
directly. I have to use a jump host B:1.1.1.1:1111
. Is there any methods I can use to make A
access the public web that I can download some packages.
One methods I know is the ssh proxy. But I only made it without jump host. The procedure is listed below:
- Log in the server with Remote forwarding.
ssh -R PortA:localhost:22 XXX@ServerIP
- Launch out a Dynamic forwarding in Server.
ssh -ND 1080 -p PortA YYY@localhost
- Export the port as proxy in Server.
export all_proxy=socks5://127.0.0.1:1080
Do you have any improvements for this method or other alternatives that I can access apt
from the server A
.