Description

This function retrieves the server's SSH port.

Examples 


https://hostname.example.com:2083/cpsess##########/execute/SSH/get_port

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List the port that SSH listens to.
$get_port = $cpanel->uapi(
    'SSH', 'get_port'
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List the port that SSH listens to.
my $get_port = $cpliveapi->uapi(
    'SSH', 'get_port',
);

 

<!-- Retrieve the port that SSH listens to. -->
[% data = execute( 'SSH', 'get_port' ); %]

 

uapi --user=username SSH get_port

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": {
    "port": "22"
  }
}

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
portinteger

The server's SSH port.

A positive integer.

22