0

I'll explain the situation and ask at the end.

I have a work computer, a Mac. On this Mac I have this command saved:

ssh -n -f -T -N -L {port} {server IP} {email} -i {path to secret RSA key}

(The curly braces are just to let you know what there is there)

I need to execute that command to initiate an ssh tunnel, and I need to give a password for bash to be able to retrieve the secret RSA key.

Then I open DBeaver and I connect to an Exasol database using my credentials and entering through 127.0.0.1 (so the port is forwarded to the home ip by default) and the same port given in the bash command.

Here is a list of all data given:

  • server port (= tunnel port also on my computer, apparently)
  • server IP
  • email (which I suppose is myuser@serverdomain.sthg)
  • key to the file containing the RSA key
  • 127.0.0.1, as the IP I use to connect to the Exasol database
  • server port, which is the same as the one above
  • user for the database
  • and password for that user for the database

I want to deploy a program that regularly retrieves data from this DWH. I had two ideas:

  1. Do everything in python.

Now, I would like to use paramiko, sshtunnel and pyexasol (python libraries) to write a program but for the life of me I've read so many stack overflow posts and tried so many combinations of ssh tunnel variables. And it doesn't help that pyexasol is a new and seemingly isolated and stagnant project, so I can't do the ssh there.

  1. deploy a docker container that runs bash to execute that command and then use bash itself or a python program to connect to the database and retrieve the data.

But I know very little about network architecture and Idk how this can even work.

Question1:

could you help me:

  1. either with a code to open an ssh tunnel using sshtunnel

  2. or with an idea of how I can do this with Docker

Question2:

is it even possible to deploy this? Or does the ssh tunnel forwarding NEED to come from THIS PARTICULAR COMPUTER for the server to accept it?

Thank you if you read all of this!

Community
  • 1
  • 1
DevilHell
  • 1
  • 1
  • Am I understanding correctly that you initiate an SSH tunnel because the Exasol database is not exposed in any other way? And you're looking for a way to initiate that SSH-tunnel from a script (problem #1) and then access the Exasol database from the same script (problem #2, completely independent)? – Grismar Jan 21 '20 at 03:39
  • Using `paramiko` and `sshtunnel` I had little trouble opening an ssh tunnel from a Python script, which is then available to access services on the other end, so perhaps you should share the implementation you think should be correct and get people to help you with that problem first, before tackling the Exasol connection problem (which I have no experience with or access to). – Grismar Jan 21 '20 at 06:20

0 Answers0