2

Is there a way to ssh to a server and run a PythonOperator with Airflow? I am looking something like SSHExecuteOperator but instead of executing a bash command execute a python callable.

1
  • 1
    Where you able to solve this? Commented Jul 27, 2018 at 13:06

1 Answer 1

2

Its ssh privacy issue

  1. goto your host ssh server and run ssh-keygen -t rsa and press enter all the way
  2. You will get 2 rsa files.copy that file to airflow env and copy its full path
  3. The Just add the below in your connection from the airflow UI

     {"key_file": "/usr/local/airflow/.ssh/id_rsa.pub", "no_host_key_check": true}
    

    Recompile the DAG and run it

Sign up to request clarification or add additional context in comments.

2 Comments

where (in which field) would you add this in airflow UI connections?
extra field in Airflow UI connection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.