
File system Command
CertifiedRun commands over SSH
File system Command
Run commands over SSH
Executes one or more commands on a remote host via SSH. Supports PASSWORD, PUBLIC_KEY, or OPEN_SSH auth. Default port 22 and strict host key checking off (no). Allow weak rsa-sha1 only when enableSshRsa1 is true.
type: io.kestra.plugin.fs.ssh.CommandExamples
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 through a proxy command
id: fs_ssh_proxy_command
namespace: company.team
tasks:
- id: command
type: io.kestra.plugin.fs.ssh.Command
host: host
username: user
authMethod: PASSWORD
password: "{{ secret('SSH_PASSWORD') }}"
proxyCommand: |
cloudflared access ssh --service-token-id {{ secret('SSH_PROXY_SERVICE_TOKEN_ID') }} --service-token-secret {{ secret('SSH_PROXY_SERVICE_TOKEN_SECRET') }} --hostname proxy_host
commands:
- mycmd
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
1Commands to execute
host *Requiredstring
Remote host
authMethod string
PASSWORDPASSWORDPUBLIC_KEYOPEN_SSHSSH authentication configuration
When authMethod is OPEN_SSH, access to local SSH config must be allowed with allow-open-ssh-config: true in plugin defaults:
kestra:
plugins:
configurations:
- type: io.kestra.plugin.fs.ssh.Command
values:
allow-open-ssh-config: true
enableSshRsa1 booleanstring
falseEnable the disabled by default RSA/SHA1 algorithm
env object
Environment variables to pass to the SSH process
openSSHConfigPath string
OpenSSH config file path
Used when authMethod is OPEN_SSH. Access must be allowed via plugin configuration.
password string
Password
Required for PASSWORD auth; optional for OPEN_SSH when config supplies credentials.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
port string
22Remote port
privateKey string
Private SSH key
OpenSSH private key content for PUBLIC_KEY auth.
privateKeyPassphrase string
Private key passphrase
Optional passphrase for the private key.
proxyCommand string
Proxy command
Optional local command used to establish the SSH transport (OpenSSH ProxyCommand semantics).
Example: cloudflared access ssh --service-token-id ... --service-token-secret ... --hostname ...
strictHostKeyChecking string
noStrict host key checking
One of yes|no|ask. Default no.
username string
Username
Required for PASSWORD and PUBLIC_KEY methods.
Outputs
exitCode integer
0The exit code of the entire flow execution
vars object
The values extracted from executed commands using the Kestra outputs format