10

I've got some Python code that uses Omniorb to connect to a corba server, and it all works fine.

Now I'd like to be able to connect to a server behind a firewall by creating an ssh tunnel, but it's not working.

As far as I can tell from wireshark trace, the server is redirecting me to its IP address - which is of course a local network address I cannot reach.

It there any way to handle this and tell the server not to redirect my client? I have no ability to modify the server nor change its IP, etc. Or can I modify my client to fake it's connection so the server accepts it?

xorsyst
  • 7,897
  • 5
  • 39
  • 58
  • 1
    Are you able to ssh to the box you want to connect to? Alternatively, can you ssh to a box that can ssh to the box running the server you want to connect to? If so, and I understand your problem correctly, I can show you how to set up the ssh tunnel correctly. – Stephen Sep 29 '17 at 17:16
  • @Stephen, the problem is not setting up the ssh tunnel. The issue is the client says "connect to 127.0.0.1", the server receives this through the tunnel and replies "I'm not at 127.0.0.1, I'm at 10.1.2.3", and then the client tries to connect to that address! I'm trying to find a way to make the server not perform the redirect. – xorsyst Oct 03 '17 at 11:05
  • It sounds like you set up your tunnel to forward to 127.0.0.1. Can you post the ssh command you are using? – Stephen Oct 03 '17 at 16:14

1 Answers1

0

The problem would become much simpler if you used a SSH Socks Proxy instead of a SSH Tunnel

ssh -D 8888 <user>@<machine>

Now you have a proxy running at socks5://127.0.0.1:8888. Next is how to use it with your code. I have no experience with CORBA, so I can only provide options to explore

  1. Configure proxy in Omniorb if the connection supports it
  2. If Omniorb internally uses urllib or something then you can use something like this
  3. If that option also doesn't work then you can force your python script through socksify
  4. If that also doesn't work and you are on Mac, you can try forcing socks proxy at system level
Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265