My situation is like this, I have Server A which has internet

I have server B which is behind a firewall and can`t connect to the internet but I can access it thru SSH

Then I have server C D E that are in the same network as server B but they can only be accessed from server B thru SSh

I am able to give internet thru ssh tunnel proxy from server A to server B using ssh -R and then connecting back using -D from server B to A to set a port that I can use as proxy.

I kept searching on google for this issue but I couldn`t find my exact situation.

I want to be able to give internet thru one socks5 port to server C D E from server B or A if possible.

How would I go about doing that ? Thank you.

  • Did you just accidentally delete most of the question??
    – RalfFriedl
    Mar 22 at 6:44
  • @RalfFriedl Restored.
    – Kusalananda
    Mar 22 at 9:18
  • Yeah ... I was not paying attention. Thank you.
    – HunterVzP
    Mar 22 at 11:25

On server A, create a SSH connection to B, use B as a jump host to C, open a reverse SOCKS connection:

ssh -J B -R PORT C
  • -J B use B as jump host
  • -R PORT reverse proxy on PORT, requires a recent version of ssh

For details, see the manual.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.