Executes a non-interactive shell command using SSH.
Depending on the shell of the remote machine, it is usually possible to provide a full command line, including multiple commands and shell directives.The node makes the exit code of the command(s) available as a flow variable. If enabled, the standard out and standard error are similarly captured. Placeholders can be used to insert input and output files or folders into the command string if so desired.
Important Considerations:
- By default the node tests for a POSIX compliant
sh
shell and refuses execution if none is found. This is done to so that any input and output file/folder paths can be securely passed to the command. In case this enforcement is disabled with the setting in the advanced “Security” settings and no compliant shell is found, then paths are directly inserted into the command string and special characters in them are NOT escaped because the target shell and its quoting and escaping mechanism is unknown. Thus, the paths have to be manually escaped and quoted in the command string to prevent syntax errors and command injection . The “Forbidden Characters” option provides a way to reject paths if they contain certain characters, which is especially important if the paths are provided via flow variable ( which is NOT recommended ). More information can be found in the relevant option descriptions. - Upon cancellation, the node sends a
CTRL-C
to the target shell and then terminates. Note that a remote command may continue to execute beyond that. This may happen either because the current program ignores the signal, or because the shell jumped to the next specified command. In POSIX this can be avoided by using conditional (&&
) instead of sequential (;
) execution. In either case these commands may have to be canceled manually or with subsequent SSH External Tool nodes. - Each command execution requests a shell session from the SSH server. These sessions are shared with SFTP sessions from the preceding SSH Connector. The number of available shell sessions can be increased in the advanced tab of the SSH Connector.