Airflow SSHHook without hostkey

2.8k Views Asked by At

I'm running Airflow 1.10 and attempting to access an SFTP using the SFTP operator and sensor. This relies on the SSHHook and thus I've created an SSH connection with host, login, password, port, and extra {"no_host_key_check": "true"}. However, I'm still getting the error "paramiko.ssh_exception.SSHException: No hostkey for host <> found."

Has anyone successfully used the SFTPSensor without specifying a hostkey?

1

There are 1 best solutions below

0
On

You still need to provide a path to your public SSH Key as follows in extras:

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

The below links explain "difference between public key and host key and security of host key":

https://security.stackexchange.com/questions/84773/difference-between-public-key-and-host-key-and-security-of-host-key