SSH step
-
- UpdatedAug 1, 2024
- 5 minutes to read
- Xanadu
- Building applications
The SSH step executes SSH commands on an external *nix system through a ServiceNow® MID Server. The step also stores scripts and commands for the *nix systems.
- This step requires an Integration Hub subscription. For more information, see Legal schedules - Integration Hub overview.
- Integration Hub supports ServiceNow SSH only.
Roles and availability
The SSH step is available as an Workflow Studio action step. Users with the action_designer role can create a custom action with one or more action steps.
Sanitizing inputs
Escape all user inputs to eliminate the possibility of a malicious user executing arbitrary commands on your target server. Escape and validate data pills before the command field uses them by sanitizing arguments using Sanitize shell arguments transform functions. This transform function category automatically appears when a data pill is dropped into the Command input.
Fields
Field | Description |
---|---|
Connection Details | |
Connection | Type of connection to use.
To learn more about connections and credentials, see Introduction to credentials, connections, and aliases. |
Connection Alias | Connection & Credential alias record that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases. The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Use Connection Alias is selected from the Connection list. |
Credential Alias | Credential alias that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias
eliminates the need to configure multiple credentials when using an action in multiple environments. Likewise, if the credential information changes, you don't need to update your custom action. To learn more
about connections and credentials, see credentials, connections, and aliases.
The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Define Connection Inline is selected from the Connection list. Note: The SSH step requires a credential record that supports either SSH private key credentials or SSH credentials. This step does not support Windows credentials where the Use MID Server
service account option is selected. |
Host | Host name or IP address of the target server. This field is available when Define Connection Inline is selected from the Connection list. |
Port | Port number to communicate with the server. This field is available when Define Connection Inline is selected from the Connection list. |
MID Selection |
Option to select a specific MID Server or MID Cluster. Choose any one of the following options.
|
MID Application | Option to use a MID Server to run the SSH step. This field is available when Define Connection Inline is selected from the Connection list and Auto-Select MID Server is selected from the MID Selection list. |
Capabilities | Capability of the MID Server. Select SSH. This field is available when Define Connection Inline is selected from the Connection list and Auto-Select MID Server is selected from the MID Selection list. |
MID Server | Data pill of the required MID Server. This field is available when Define Connection Inline is selected from the Connection list and Specific MID Server is selected from the MID Selection list. |
MID Cluster | Data pill for the MID Cluster you want to use. This field is available when Define Connection Inline is selected from the Connection list, and Specific MID Cluster is selected from the MID Selection list. |
SSH Configuration | |
Working Directory | Optional target directory on the target host where the command is run. |
Command | Command that runs on the target directory. The command can also include MID Server scripts. See Advanced SSH script options for more information. Note: Escape and
validate data pills before the command field uses them by sanitizing arguments
using a preprocessing Script step. For more information, see Sanitizing arguments using
the escape class and function. |
Long Running | Option to disable the SSH connection timeout for commands that might take longer than the default time of 120 seconds to run. When selected, the engine detaches from the execution thread until completion. |
Sudo Mode | Option to elevate privileges to execute the script. |
Action error evaluation
- If this step fails
- Data type: Choice
Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.
Advanced SSH script options
${syncFile()}
parameter. The system uses this parameter to locate the
named script in the MID Server Script
File [ecc_agent_script_file] table and run it on the target host. For example, a bash script
can be expressed as:
main_script.bash
) can reference another script
(my_include.bash
) as well as a separate file
(.my_profile
) located on the target host. Both scripts and the file
referenced must be synced to the MID Server, using the
${syncFile()}
parameter, to execute
properly.To see the list of available MID Server scripts, navigate to .