Command Command

yaml
type: "io.kestra.plugin.fs.ssh.Command"

Send a command to a remote server using SSH.

Examples

Run SSH command using password authentication

yaml
id: "command"
type: "io.kestra.plugin.fs.ssh.Command"
host: localhost
port: "22"
authMethod: PASSWORD
username: foo
password: pass
commands: ['ls']

Run SSH command using public key authentication

yaml
id: "command"
type: "io.kestra.plugin.fs.ssh.Command"
host: localhost
port: "22"
authMethod: PUBLIC_KEY
username: root
privateKey: secret('SSH_RSA_PRIVATE_KEY')
commands: ['touch kestra_was_here']

Properties

authMethod

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Default: PASSWORD
  • Possible Values:
    • PASSWORD
    • PUBLIC_KEY

Authentication method

commands

  • Type: array
  • SubType: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min items: 1

The list of commands to run on the remote server

host

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

Hostname of the remote server

username

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

Username on the remote server, required for password auth method

warningOnStdErr

  • Type: boolean
  • Dynamic:
  • Required: ✔️
  • Default: true

Use WARNING state if any stdErr is sent

env

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

Environment variables to pass to the SSH process.

password

  • Type: string
  • Dynamic: ✔️
  • Required:

Password on the remote server, required for password auth method

port

  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: 22

Port of the remote server

privateKey

  • Type: string
  • Dynamic: ✔️
  • Required:

Private SSH Key to authenticate, required for pubkey auth method

privateKeyPassphrase

  • Type: string
  • Dynamic: ✔️
  • Required:

Passphrase used in order to unseal the private key, optional for pubkey auth method

strictHostKeyChecking

  • Type: string
  • Dynamic:
  • Required:
  • Default: no

Whether to check if the host public key could be found among known host, one of 'yes', 'no', 'ask'

Outputs

exitCode

  • Type: integer
  • Dynamic:
  • Required: ✔️
  • Default: 0

The exit code of the entire Flow Execution

vars

  • Type: object
  • Dynamic:
  • Required:

The value extracted from the output of the executed commands