Tunneling through a bastion host on mac for python

Viewed 166

I have to run a python script on some production level data and in order to do that I have to hop through a bastion host. I know on PC you would typically use putty to set up your ssh tunnels as you hop to your host and then call localhost.

However how does that work on a Mac? I have my host xum345434@bastion_host.com that I hop to. From there how do I setup my aws db connections so that I can simply call one of those connections?

mssql-prod.aws.endpoint.com

My python script is updating a sql tables at the end of everyday, but I don't know how to setup those connections on a mac.

import os
import io
import pyodbc
import pandas as pd
import sys
conn = pyodbc.connect(server = 'localhost,14330', user='usernamae',
                                            password = 'my_password', database = 'Xacation')

cursor = conn.cursor()
cursor.execute('''with updated_transations as(select * from my table ''')
0 Answers
Related