Airflow bastion ssh config

30 Apr 2018

A sample config for connecting to Airflow UIs using a bastion host in the middle.

ssh config :

Host dev-bastion
 HostName 10.69.7.20
 User rchamarthi
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/rchamarthi.pem

Host dev-airflow-rchamarthi
 HostName 10.69.1.245
 User rchamarthi
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/rchamarthi.pem
 ServerAliveInterval 15
 TCPKeepAlive yes
 Protocol 2,1
 # redis
 LocalForward 16379 localhost:6379
 # airflow ui
 LocalForward 18081 localhost:8081
 # airflow ui rchamart
 LocalForward 18082 localhost:8082
 # flower ui
 LocalForward 15555 localhost:5555
 ProxyCommand ssh dev-bastion -W %h:%p

If you are on windows.

  • convert your pem file to ppk using putty gen. Load pem and then click “save private key” an save the file as .ppk

image

image

  • Don’t forget to save your session after you load your key.

  • Click yes to continue to cache the key.

image

  • Now the actual server that you want to connect to by hopping on to Bastion 👍

image

C:\Program Files\PuTTY\plink.exe” dev-bastion -agent -nc %host:%port

who am i

I am a data engineer with interests in databases, data science, algorithms and programming in general.

where am i

linkedin//rchamarthi
stackoverflow/users/237939/rchamarthi
Content available under Creative Commons (BY-NC-SA) unless otherwise noted.
This site is hosted at Github Pages and created with Jekyll. It uses the papyrus theme