Use the SSH plugin to execute commands on a remote server.

Example

kind: pipeline
name: default

steps:
- name: ssh
  image: appleboy/drone-ssh
  settings:
    host:
      - example1.com
      - example2.com
    username: ubuntu
    password:
      from_secret: ssh_password
    port: 22
    command_timeout: 2m
    script:
      - echo "Hello World"

Properties

  • host

    stringrequired

    Hostname or IP address of the server.

    Default: none

  • port

    stringoptional

    Port of the server.

    Default: 22

  • username

    stringoptional

    account for target host user.

    Default: none

  • password

    stringoptional

    Password to login to the server.

    Secret recommended

    Default: none

  • key

    stringoptional

    plain text of user private key

    Secret recommended

    Default: none

  • key_path

    stringoptional

    Path to the private key to login to the server.

    Default: none

  • envs

    arrayoptional

    custom secrets which are made available in the script section.

    Default: none

  • script

    stringoptional

    Command to execute on the server.

    Default: none

  • script_stop

    booleanoptional

    stop script after first failure.

    Default: false

  • timeout

    stringoptional

    Timeout is the maximum amount of time for the ssh connection to establish.

    Default: 30s

  • command_timeout

    stringoptional

    Command timeout is the maximum amount of time for the execute commands

    Default: 10m

  • proxy_host

    stringoptional

    Proxy hostname or IP address.

    Default: none

  • proxy_port

    stringoptional

    Proxy port.

    Default: none

  • proxy_username

    stringoptional

    Proxy username.

    Default: none

  • proxy_password

    stringoptional

    Proxy password.

    Secret recommended

    Default: none

  • proxy_key

    stringoptional

    lain text of proxy private key.

    Secret recommended

    Default: none

  • proxy_key_path

    stringoptional

    Path to the private key to login to the proxy.

    Default: none