Description

This function tests an SSH connection to another server.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/check_remote_ssh_connection?api.version=1&host=example.com&port=22
https://hostname.example.com:2087/cpsess##########/xml-api/check_remote_ssh_connection?api.version=1&host=example.com&port=22
whmapi1 check_remote_ssh_connection host=example.com port=22

{
  "data": {
    "server_software": "OpenSSH_5.3",
    "comment": null,
    "received": "SSH-2.0-OpenSSH_5.3",
    "protocol_versions": [
      "2.0"
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "check_remote_ssh_connection"
  }
}
<result>
    <data>
        <server_software>OpenSSH_5.3</server_software>
        <comment/>
        <received>SSH-2.0-OpenSSH_5.3
        </received>
        <protocol_versions>2.0</protocol_versions>
    </data>
<metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>check_remote_ssh_connection</command>
</metadata>
</result>

Parameters

ParameterTypeDescriptionPossible valuesExample
hoststring

Required

The remote server's hostname.

An absolute file path.

example.com
portinteger

The remote server's port number.

This parameter defaults to 22.

A valid positive integer.22

Returns

ReturnTypeDescriptionPossible valuesExample
protocol_versionsstring

The available SSH protocol versions.

  • A valid string.
  • undef — If the local and remote servers connect successfully.
2.0 

server_software

string

The version of the remote server's SSH server software.

  • A valid string.
  • undef — If the local and remote servers connect successfully.
OpenSSH_5.3
commentstringThe remote connection's comment section.
  • A valid string.
  • undef — If the local and remote servers connect successfully.
null
receivedstringThe raw data from the remote server.

A valid string.

SSH-2.0-OpenSSH_5.3