0

I hope my question make sense

So I have a JumpServer that has a VPN connection to another subnet ex. 10.x.x.x. This subnet is only accessible via JumpServer. So I can connect to 10.x.x.x from my local machine by using socks proxy:

  • ssh root@JumpServer -D 9999
  • Add config on /etc/proxychains socks5 127.0.0.1 9999 then proxychains ssh [email protected]

When I perform proxychains SSH, the local address of 10.x.x.x is 192.x.x.x. and I discovered some hosts

From my local machine, how do I connect to the local address of 10.x.x.x

basically the chain is 127.0.0.1:9999 ... 10.x.x.x:22 ... 192.x.x.x:PortNumber?

1 Answer 1

0

You don't need to use proxychains for this, probably. Ssh has a "jump proxy" option for this:

ssh -J root@JumpServer [email protected]

And you can do multiple jumps if you need to, too:

ssh -J root@JumpServer,[email protected] [email protected]

You can encode this into your .ssh/config for convenience (untested):

192.x.x.x
    Username root
    ProxyJump 10.x.x.x

10.x.x.x
    Username root
    ProxyJump JumpServer

JumpServer
    Username root

Then ssh 192.x.x.x should just work.

I'd use a named alias in '.ssh/config' in addition to the above, but you don't have to:

webserver
    Hostname 192.x.x.x
    Username root
    JumpServer 10.x.x.x

Now ssh webserver should work.

You must log in to answer this question.

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