
Command
Send a command to a remote server using SSH.
Send a command to a remote server using SSH.
Send a command to a remote server using SSH.
type: "io.kestra.plugin.fs.ssh.Command"Examples
Run SSH command using password authentication
id: fs_ssh_command
namespace: company.team
tasks:
- id: command
type: io.kestra.plugin.fs.ssh.Command
host: localhost
port: "22"
authMethod: PASSWORD
username: foo
password: "{{ secret('SSH_PASSWORD') }}"
commands:
- ls
Run SSH command using public key authentication (must be an OpenSSH private key)
id: fs_ssh_command
namespace: company.team
tasks:
- 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
Run SSH command using the local OpenSSH configuration
id: ssh
namespace: company.team
tasks:
- id: ssh
type: io.kestra.plugin.fs.ssh.Command
authMethod: OPEN_SSH
host: localhost
password: "{{ secret('SSH_PASSWORD') }}"
commands:
- echo "Hello World"Properties
commands*Requiredarray
1The list of commands to run on the remote server
host*Requiredstring
Hostname of the remote server
authMethodstring
PASSWORDPASSWORDPUBLIC_KEYOPEN_SSHSSH authentication configuration
When the authentication method is set to OPEN_SSH, access to the local OpenSSH host configuration must be explicitly allowed.
This ensures that the plugin can use SSH settings (such as Host, User, Port, or IdentityFile) defined in the user's OpenSSH configuration file.
To enable this, configure the plugin using "allow-open-ssh-config" in the plugin configuration, as shown below:
kestra:
plugins:
configurations:
- type: io.kestra.plugin.fs.ssh.Command
values:
allow-open-ssh-config: true
enableSshRsa1booleanstring
falseEnable the disabled by default RSA/SHA1 algorithm
envobject
Environment variables to pass to the SSH process.
openSSHConfigPathstring
OpenSSH configuration file path used when the authentication method is OPEN_SSH.
passwordstring
Password on the remote server, required for password auth method
portstring
22Port of the remote server
privateKeystring
Private SSH Key to authenticate, required for pubkey auth method
privateKeyPassphrasestring
Passphrase used in order to unseal the private key, optional for pubkey auth method
strictHostKeyCheckingstring
noWhether to check if the host public key could be found among known host, one of 'yes', 'no', 'ask'
usernamestring
Username on the remote server, required for password auth method
Outputs
exitCodeinteger
0The exit code of the entire flow execution.
varsobject
The values extracted from executed commands using the Kestra outputs format.