Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function tests an SSH connection to another server.

Examples 


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

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "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"
  }
}
 Output (XML)
<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>

Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

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