DiscoverSshHostKey performs the SSH handshake needed to read the remote host key before any login occurs.
Use it inside the DiscoverSshHostKey operation to capture the asset's trusted host key, optionally record the server software banner, and then return the discovered value with WriteResponseObject.
{
"DiscoverSshHostKey": {
"HostKeyVariableName": "HostKey",
"SoftwareVersionVariableName": "GLOBAL:ServerSoftwareName",
"Port": "%Port%",
"NetworkAddress": "%Address%",
"Timeout": "%Timeout%"
}
}| Name | Type | Required? | Description |
|---|---|---|---|
HostKeyVariableName |
String | Yes | Variable that receives the discovered host key value. |
SoftwareVersionVariableName |
String | No | Variable that receives the server software banner reported during negotiation. |
NetworkAddress |
String expression | Yes | Target host or IP address. Scripts usually pass %Address% here. |
Port |
Integer expression | No | SSH port number. |
AutoAdjustCiphers |
Boolean | No | Broadens SSH algorithm negotiation for older systems. Some scripts expose this through a custom variable such as EnableAllCiphers. |
Timeout |
Integer expression | No | Discovery timeout value. |
{
"DiscoverSshHostKey": {
"HostKeyVariableName": "HostKey",
"Port": "%Port%",
"NetworkAddress": "%Address%",
"Timeout": "%Timeout%"
}
}
{ "WriteResponseObject": { "Value": "%HostKey::$%" } }From samples/ssh/generic-linux-ssh-keys/GenericLinuxWithSSHKeySupport.json:
{
"DiscoverSshHostKey": {
"HostKeyVariableName": "HostKey",
"SoftwareVersionVariableName": "GLOBAL:ServerSoftwareName",
"Port": "%Port%",
"NetworkAddress": "%Address%",
"Timeout": "%Timeout%"
}
}
{ "WriteResponseObject": { "Value": "%HostKey::$%" } }From samples/ssh/linux-ssh-batch-mode/LinuxSshBatchModeExample.json:
{
"DiscoverSshHostKey": {
"HostKeyVariableName": "HostKey",
"Port": "%Port%",
"NetworkAddress": "%Address%",
"Timeout": "%Timeout%"
}
}
{ "WriteResponseObject": { "Value": "%HostKey::$%" } }
DiscoverSshHostKeydoes not requireLogin,Password, orUserKey. It only performs the pre-authentication SSH negotiation needed to read the host key.
The command writes the discovered value into
HostKeyVariableName; returning it to the platform is a separate step, usuallyWriteResponseObject.
Note:
RetrieveSshHostKeyis not supported by the Scriptable custom platform engine. OnlyDiscoverSshHostKeycan be implemented.