{"library":"apache-airflow-providers-ssh","title":"Apache Airflow SSH Provider","description":"This package provides operators, hooks, and sensors for interacting with SSH, SFTP, and SCP within Apache Airflow DAGs. It enables automation of tasks on remote servers via SSH protocol, including command execution and file transfers, supporting various authentication methods. The current version is 4.3.3, and its release cadence is tied to the broader Apache Airflow provider release schedule, with frequent updates.","language":"python","status":"active","last_verified":"Wed May 20","install":{"commands":["pip install apache-airflow-providers-ssh"],"cli":null},"imports":["from airflow.providers.ssh.operators.ssh import SSHOperator","from airflow.providers.ssh.hooks.ssh import SSHHook","from airflow.providers.ssh.hooks.sftp import SFTPHook"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom datetime import datetime\nfrom airflow.models.dag import DAG\nfrom airflow.providers.ssh.operators.ssh import SSHOperator\n\n# For local testing, ensure you have an 'ssh_default' connection configured in Airflow UI\n# or via an environment variable, e.g., AIRFLOW_CONN_SSH_DEFAULT=ssh://user@hostname:22/?key_file=/path/to/key\n# For this example, we'll mock the connection_id.\n\n# Example of setting connection details via environment variable for local execution\n# os.environ['AIRFLOW_CONN_SSH_DEFAULT'] = 'ssh://your_user@your_host:22'\n# If using a private key file:\n# os.environ['AIRFLOW_CONN_SSH_DEFAULT'] = 'ssh://your_user@your_host:22?key_file=/path/to/your/private_key.pem'\n\nwith DAG(\n    dag_id='ssh_operator_quickstart',\n    start_date=datetime(2023, 1, 1),\n    schedule_interval=None,\n    catchup=False,\n    tags=['ssh', 'example'],\n) as dag:\n    ssh_task = SSHOperator(\n        task_id='run_remote_command',\n        ssh_conn_id='ssh_default',  # Ensure this connection exists in Airflow\n        command='echo \"Hello from remote host $(hostname)\" && ls -l',\n        cmd_timeout=10,  # Timeout for the command execution\n    )\n","lang":"python","description":"This example demonstrates a basic DAG using the `SSHOperator` to connect to a remote server and execute a shell command. Before running, configure an 'SSH' connection in your Airflow UI (Admin -> Connections) with `Conn Id` as `ssh_default`, providing `Host`, `Login (Username)`, and `Port`. For authentication, you can specify `Password`, `Key File` path, or `Private Key` content in the 'Extra' field as a JSON object (e.g., `{\"key_file\": \"/path/to/your/key.pem\"}`).","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]},"compatibility":{"tag":"reviewed","tag_description":"minor failures on some runtimes or slightly older test data","last_tested":"2026-05-20","installed_version":"4.1.0","pypi_latest":"5.0.1","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":90,"avg_install_s":23,"avg_import_s":5.01,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":4.37,"mem_mb":67.1,"disk_size":"254.1M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":4.71,"mem_mb":67,"disk_size":"247.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":25.2,"import_time_s":3.19,"mem_mb":67.1,"disk_size":"252M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":3.36,"mem_mb":67,"disk_size":"245M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":5.67,"mem_mb":72.8,"disk_size":"275.3M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":6.47,"mem_mb":72.7,"disk_size":"267.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":23.9,"import_time_s":5.08,"mem_mb":72.8,"disk_size":"273M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":5.22,"mem_mb":72.7,"disk_size":"266M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":5.15,"mem_mb":70.6,"disk_size":"265.1M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":5.77,"mem_mb":71.4,"disk_size":"257.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":18.6,"import_time_s":5.16,"mem_mb":70.6,"disk_size":"264M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":5.7,"mem_mb":71.4,"disk_size":"257M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":4.75,"mem_mb":71.2,"disk_size":"266.9M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":5.29,"mem_mb":72,"disk_size":"259.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":18.4,"import_time_s":4.75,"mem_mb":71.2,"disk_size":"266M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":5.51,"mem_mb":72,"disk_size":"259M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"218.7M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"apache-airflow-providers-ssh","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":29,"import_time_s":null,"mem_mb":null,"disk_size":"214M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"apache-airflow-providers-ssh","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}