0

I have to set up an ssh/sftp connection which needs a certain configuration, and I've been looking around but didn't find an answer. I'm not sure it's even possible without some work around.

I have 4 IPs (like the below example):

  1. 192.168.0.10 - User PC

  2. 172.16.0.10 - SSH gateway

  3. 10.0.0.10 - Proxy server

  4. 30.30.30.30 - SSH server on the internet

What I need is to SSH from 1 to 4, using the ssh gateway, which requires the proxy (3) to access the internet. Currently i'm able to connect from 1 to 4 if i set up the proxy on 1 without passing by 2, but this is not acceptable. And I'm able to connect from 2 to 4 using the proxy. But if I try to connect from 1 to 4, using the gateway, I'm not sure how to tell the gateway to use the proxy. The tools I can use are netcat and connect-proxy on machine 1 and 2, but ProxyJump is not installed.

Any suggestions?

0

For anybody who is looking for an answer to the same question, i found a way to make this work:

~/.ssh/config
Host gateway
Hostname 172.16.0.10
User gatewayuser

Host sshserver
Hostname 30.30.30.30
User sshuser
ProxyCommand ssh gateway connect-proxy -H 10.0.0.10:8080 %h %p

Then from the client machine 192.168.0.10:

$ ssh sshserver

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.